CREATE TABLE
We use sql CREATE TABLE statement to create table in a database. Sql statement is used to create table, delete table, insert and update table,delete data in table.The structure consists of the name of a table and names of columns in the table with each column's data type.The datatype specifies the type of data the column can hold (e.x. varchar, integer, date, etc.).
syntax of the SQL CREATE TABLE statement is:
- create table table_name(
- column1 data type,
- column2 data type,
- column3 data type,
- column4 data type,
- ...
- columnN data type);
NOTE➗
• Column →The column specify the names of the columns of the table.
• table_name → it is the name of the table.
• data type → it can be an integer string, date, etc.
EXAMPLE:
create table command in sql
→ create table student(name varchar(20),roll integer,course varchar(20));
・ when you write this the student table will be created.
→insert into student values ('om',01,'civil');
・ Now after creating table we have to put these values in student table.
Now to see your table you have to write syntax i.e.
select * from student;
So this is how we can create table hope you like our todays topic.
Post a comment in comment section if you like this information thanks and have a great day ahead.
Comments
Post a Comment