Steps: 1. Open "sql server"; 2. Use "creat table student();" to create a table; 3. Use "char()" to define the type of name, gender, and age; 4. Just use "insert into student values();" to define table attributes.
Steps:
create table Student( Sno char(10), Sname varchar(20), Ssex char(2), Sage tinyint, Sdept varchar(20), ) insert into Student values('201215121','李勇','男','20','CS'), ('201215122','刘晨','女','19','CS'), ('201215123','王敏','女','18','MA'), ('201215125','张立','男','19','IS');
We open a new query in sql
We build a table called student
We enter the student number and name, and the type is represented by characters
We enter gender, age, and major, and define them with appropriate types respectively.
At this time we press execute
and we can see that the system displays that the table was successfully created.
Recommended tutorial: "sql video tutorial"
The above is the detailed content of How to create student table using sql statement?. For more information, please follow other related articles on the PHP Chinese website!