Sql Query To Insert The Record In The Table By Defining The Column Name


To insert single or multiple records in an already-created table. Then we can use an ' INSERT ' Statement.

First, we will create a user_detail table.

Then we insert the record in the table by defining the column name.

After that, we will show the inserted data.

SQL Query
CREATE TABLE user_detail ( id int primary key, name varchar(50) not null, email varchar(50) unique, dateofbirth date ); INSERT INTO user_detail(id,name,email,dateofbirth) VALUES (2,'Fresher bell','[email protected]','2022-08-02'); SELECT * FROM user_detail;
Output