SQL Insert

SQL Insert into statement

In this tutorial, we explain how to SQL insert into a statement insert the new record in the SQL database table.

Syntax:

SQL Insert into table syntax:



sql insert into

  
INSERT INTO table_name(column 1,column 2,.....column N) 
VALUES (values 1,values 2,....);
  
  


In the above syntax, you will see the both specified column and values to be inserted query. In case you will add values for all of the tables, you will be adding a table in the SQL query. you don't need to specify the column names. Here, Below how to use syntax to insert the values to follow: 


 
  
 INSERT INTO table_name  VALUES (values 1,values 2,....); 
  
  


  
  create table student(id int not null primary key,student_name varchar(25) not null,
  class int not null,age int not null,phone_no varchar(20) not null);
  
  


  
INSERT into student(id,student_name,class,age,phone_no) values(101,'varun', 6 , 15, 9874563211);
INSERT into student(id,student_name,class,age,phone_no) values(101,'varun', 6 , 16, 9874563211);
INSERT into student(id,student_name,class,age,phone_no) values(102,'arun', 6 , 15,8912345641);
INSERT into student(id,student_name,class,age,phone_no) values(103,'vishva', 6 , 15, 8974563211);
INSERT into student(id,student_name,class,age,phone_no) values(104,'kumaran', 6 , 18, 1123456789);
INSERT into student(id,student_name,class,age,phone_no) values(105,'chandra', 6 , 15, 9987654321);
INSERT into student(id,student_name,class,age,phone_no) values(106,'kumar', 6 , 17, 9999874563);
INSERT into student(id,student_name,class,age,phone_no) values(107,'priya', 6 , 15, 888777897);
INSERT into student(id,student_name,class,age,phone_no) values(108,'swetha', 6 , 16, 7896541239);
INSERT into student(id,student_name,class,age,phone_no) values(109,'abinaya', 6 , 16, 6659874123);
INSERT into student(id,student_name,class,age,phone_no) values(110,'sarah', 6 , 17, 1235648977);
  
  

Another way to SQL Insert :
  
INSERT INTO student VALUES(101,'varun',6,15,9874563211);
  
  



sql insert into


Previous Post Next Post