SQL 基本建表语句
1. Create Table
CREATE TABLE sample_table
(
column1 data_type(size) constraint_name,
column2 data_type(size) constraint_name,
column3 data_type(size) constraint_name,
....
);
sample_table: Name of the table to be created.
data_type: Type of data that can be stored in the field.
constraint_name: Name of the constraint.
for example- NOT NULL, UNIQUE, PRIMARY KEY etc.
## Students table demo ##
Create table Students
(sno char(11),
sname char(20),
ssex char(2),
sage int,
sdept char(20),
primary key(sno))
so we got it like this:
Students (sno, sname, ssex, sage, sdept)