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:

  1. create table table_name(  
  2. column1 data type,  
  3. column2 data type,  
  4. column3 data type
  5. column4 data type,
  6. ... 
  7. 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

Popular posts from this blog