---
title: "Explain the role of the INSERT statement in SQL with an example."  
description: "Explain the role of the INSERT statement in SQL with an example."  
author: "Steilla Mitchel"  
published: 2023-08-30  
updated: 2023-08-30  
canonical: https://www.mindstick.com/forum/159781/explain-the-role-of-the-insert-statement-in-sql-with-an-example  
category: "mssql server"  
tags: ["mssql server", "sql server", "sql"]  
reading_time: 2 minutes  

---

# Explain the role of the INSERT statement in SQL with an example.

[Explain the role](https://www.mindstick.com/forum/160496/explain-the-role-of-the-web-xml-file-in-a-servlet-application) of the [INSERT](https://www.mindstick.com/blog/173/executing-insert-delete-or-update-query-in-sqlserver-using-ado-dot-net) [statement in SQL](https://www.mindstick.com/forum/33706/what-is-the-difference-between-having-clause-and-group-by-statement-in-sql-server) with an example.

## Replies

### Reply by Aryan Kumar

Sure. The **INSERT INTO** statement in [SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) is used to insert new rows into a table. The syntax for the **INSERT INTO** statement is as follows:

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

The `table_name` is the name of the table that you want to insert the rows into. The `column1`, `column2`, `column3`, etc. are the names of the columns in the table that you want to insert data into. The `value1`, `value2`, `value3`, etc. are the values that you want to insert into the columns.

For example, the following statement would insert a new row into the `products` table with the following values:

```plaintext
INSERT INTO products (product_id, product_name, product_price)
VALUES (1, 'iPhone 13', 999);
```

The `product_id` column is the primary key for the `products` table, so it must be unique. The `product_name` and `product_price` columns are not constrained, so they can be repeated.

The `INSERT INTO` statement can also be used to insert multiple rows into a table at the same time. To do this, you can use a comma-separated list of values for the `VALUES` clause. For example, the following statement would insert three new rows into the `products` table:

```plaintext
INSERT INTO products (product_id, product_name, product_price)
VALUES (2, 'Samsung Galaxy S22', 799),
(3, 'Google Pixel 6', 699),
(4, 'iPad Pro', 999);
```


---

Original Source: https://www.mindstick.com/forum/159781/explain-the-role-of-the-insert-statement-in-sql-with-an-example

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
