Javatpoint Logo
Javatpoint Logo

SQLite Insert Query

In SQLite, INSERT INTO statement is used to add new rows of data into a table. After creating the table, this command is used to insert data into the table.

There are two types of basic syntaxes for INSERT INTO statement:

Syntax1:

Here, column1, column2, column3,...columnN specifies the name of the columns in the table into which you have to insert data.

You don't need to specify the columns name in the SQlite query if you are adding values to all the columns in the table. But you should make sure that the order of the values is in the same order of the columns in the table.

Then the syntax will be like this:

Syntax2:

Let's take an example to demonstrate the INSERT query in SQLite database.

We have already created a table named "STUDENT". Now enter some records in that table.

Inserting values by first method:

SQLite Insert query 1

Second Method:

You can also insert the data into the table by second method.

SQLite Insert query 2

Output:

You can see the output by using the SELECT statement:

SQLite Insert query 3




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA