H2 Database Insert - H2 Database

What is H2 Database Insert?

The SQL INSERT statement is used to add new rows of data to a table in the database.

Syntax

Following is the basic syntax of INSERT INTO statement.

Using this INSERT statement, we can insert a new file or new rows right into a table. when using DIRECT clause, the results are directly affected to the target table without any intermediate step. however, even as adding values for all of the columns of the table, ensure the order of the values is in the same order as the columns in the table.

Example

Let us take an example and try to insert the following given records into the Customer table.

ID Name Age Address Salary
1 Ramesh 32 Ahmedabad 2000
2 Khilan 25 Delhi 1500
3 Kaushik 23 Kota 2000
4 Chaitail 25 Mumbai 6500
5 Hardik 27 Bhopal 8500
6 Komal 22 MP 4500
7 Muffy 24 Indore 10000

We can get all the given records into the customer table by executing the following commands.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

H2 Database Topics