To insert new records in a table , we have to use INSERT INTO command

Syntax :

INSERT INTO table_name
VALUES (value1,value2,value3,...);

If we use above syntax , we have to insert the data in all columns of table . Other wise error will be given .

If we want to insert the data in specific columns of a table then , we have to use below syntax.

Syntax :

INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);

Example :
Below query inserts the data in all columns of Student table .


INSERT INTO student VALUES( 1 , 'clement' , '5678634854' , 'russia' );

Below query inserts Student_id and Student_name in Student table . For remaining columns null value will be inserted . we will learn about null in later tutorials .


INSERT INTO student (student_id, student_name) VALUES( 2 , 'maansingh');

See the below data from a table

STUDENT_IDSTUDENT_NAMESTUDENT_MOB_NOSTUDENT_ADREES
1maansingh9887768766india
2maansingh(null)(null)