Ask a Question
  
  
  
Top Posters
Since Sunday
7
6
6
5
5
5
4
4
4
4
4
4
New Topic  
wrote...
Posts: 32
Rep: 8 0
4 days ago
Explain the essential format of the CREATE TABLE statement. Include an example.
Source  Download Study Guide
Database Processing: Fundamentals, Design, and Implementation
Edition: 15th
Authors:
Read 2 times
1 Reply
Related Topics
Replies
wrote...
4 days 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.
Learn More
Improve Grades
Help Others
Save Time
Accessible 24/7
  66 People Browsing
 202 Signed Up Today
Related Images
 10393
 60
 61