SQL – INSERT INTO Statement (to insert/add a record into table)

SQL - INSERT INTO Statement (to insert/add record into table)

SQL – INSERT INTO articulation: In this article, we will master everything about ‘Supplement INTO’ explanation in SQL with syntax and examples.

Addition INTO proclamation is utilized to include/embed another line into the table. There are two different ways of utilizing INSERT INTO.

1) To embed information in the predefined segments of the new line/to embed another record in the table

Syntax:

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

Here,

  • table_name : name of the table into which we need to embed information.
  • column1, column2, … : names of the segments/fields.
  • value1, value2, … : values of the segment/fields determined.

2) To embed information in all the segments/fields in the table

Syntax:

INSERT INTO table _name VALUES( value1, value2, ...);

Here,

  • table_name: name of the table into which we need to embed information.
  • value1, value2, … : values of all the segment/fields in the table.
SQL - INSERT INTO Statement (to insert/add a record into table)

Example:

1) Insert another record

INSERT INTO Student VALUES(5, 'Shubham','1998-12-16',88,87,78, 'Gwalior');
  • It will embed another record in the table with Enroll_No:5, Student_name: Shubham, DOB: 1998-12-16 …
SQL - INSERT INTO Statement (to insert/add a record into table)

2) Insert values in some predetermined sections

INSERT INTO Student ( Enroll_No, Student_name, city) VALUES (5, 'Shubham', 'Bhopal');
  • It will embed another record in the table with Enroll_No:5, Student_name: Shubham, DOB: 1998-12-16 …
SQL - INSERT INTO Statement (to insert/add a record into table)

Recent Posts

error: Alert: Content is protected!!