- MySQL Insert
INSERT
The
INSERT
statement inserts a new row into the table. INSERT STATEMENT
INSERT INTO jamfinity (id, name, age)
VALUES (1, 'Jamil Jahangir', 22);
We create our table in our previous post:
Let’s break down the statement:
- If we want to insert a new row into our table, we have use the code “
INSERT INTO
“ - The code
INSERT INTO
is followed by the table name. Here, the name of the table is jamfinity - The next set of clauses are very important. We write the values of the rows in the format –
VALUES (id, name, age);
- We have inserted
id
value of1
of data type –INTEGER
in thecolumn - Jamil Jahangir added to
name
column of data type –text
- 22 added to
age
column of data type –INTEGER
Important points:
- Make sure to write
INTO
afterINSERT
- End the statement with a Semicolon.