× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
5
o
5
4
m
4
b
4
x
4
a
4
l
4
t
4
S
4
m
3
s
3
New Topic  
Yeeeee89 Yeeeee89
wrote...
Posts: 483
5 years ago
Explain the essential format of the CREATE TABLE statement. Include an example.
Textbook 
Database Processing: Fundamentals, Design, and Implementation

Database Processing: Fundamentals, Design, and Implementation


Edition: 15th
Authors:
Read 72 times
1 Reply

Related Topics

Replies
wrote...
5 years ago
The essential format for the CREATE TABLE statement is:
CREATE TABLE tablename (
column-description,
column-description,
column-description,
. . .
optional table constraints
);
"Tablename" is the name that will be given to the newly created table. "Column-description" is a three-part description of each column to appear in the table. This description includes the name of the column, the column's data type, and an optional column constraint (either Primary Key, Null, or Not Null), in that order. The CONSTRAINT phrase can be used to set optional primary key, foreign key and referential integrity constraints for the table. All SQL statements must end with a semi-colon (;). Here is an example:
CREATE TABLE VEHICLE (
VIN CHAR(32),
Year INTEGER,
Make CHAR(25) NOT NULL,
CONSTRAINT VEHICLE_PK PRIMARY KEY (VIN)
);
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  983 People Browsing
Related Images
  
 268
  
 239
  
 294
Your Opinion
Which country would you like to visit for its food?
Votes: 204