CREATE TABLE statement in SQL is used to create the new table in the database.
To create a table you need to define its coloumns and each coloumn's with their data type.
CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, column4 datatype, column5 datatype, ..... columnN datatype, PRIMARY KEY( for one or more columns ) );
You can check,If you have successfully created the table by looking at the message displayed by the SQL server. Another way to chech by DESC command as follows:-
FIELD | TYPE | NULL | KEY | DEFAULT |
---|---|---|---|---|
ID | Int(11) | NO | PRI | |
NAME | Varchar(25) | NO | ||
AGE | Int(11) | NO | ||
SUBJECT | Varchar(20) | YES | NULL | |
MARKS | decimal(20, 2) | YES | NULL |
Now, you have STUDENT table available in your database through that you can use to save the required information related to students record.