in this tutorial, you will learn how to insert data in MySQL table
Syntax:
INSERT INTO table_name ( field1, field2,...fieldN )
VALUES
( value1, value2,...valueN );
Example
we have test table, now we are insert data to it.
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(100) | NO | | NULL | |
+-------+--------------+------+-----+---------+----------------+
Insert query:
mysql > INSERT INTO test
(title) VALUES('test ttile');
Insert multiple data
you can insert multiple data at once.
mysql > INSERT INTO test
(title) VALUES
('test title'),
('test title2'),
('test title3');,
this will help you to insert data in MySQL table.