SQL query for insert data in table

To insert new data in a table INSERT INTO statement is used.


There is two type of statement for insert data in a table .

In first statement the column names does not specify where the data will be inserted, only their values are specify.

INSERT INTO table_name VALUES (value1,value2,value3,...); Here value1,value2,value3,... are the values.

In the second statement both the column names and the values are specifies for insert data or record.

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

Here column1,column2,column3,... are the column name and value1,value2,value3,... are the values.

Connection failed: SQLSTATE[28000] [1045] Access denied for user 'studentdb'@'localhost' (using password: YES)