Create Table

TheCREATE TABLE statement defines the table. It has the following form:

CREATE TABLE table

(field_name sql_type [(size)] [NOT NULL] [indexl] , ...) where

• fiel d_name is the name of the field being defined

• size is the size oathe field

• NOT NULL specifies that the column can't be empty or equal to None The brackets in the statement denote optional parameters.

Here's how to create a table named Employee:

CREATE TABLE Employee (

EmpID INT NOT NULL,

Name CHAR(20),

DeptID INT NOT NULL,

CHAR denotes a character, so CHAR (20) denotes a 20-character field.

Was this article helpful?

0 0

Post a comment