insert into values mysql code example

Example 1: insert into

INSERT INTO client (prenom, nom, ville, age)
 VALUES
 ('Rébecca', 'Armand', 'Saint-Didier-des-Bois', 24),
 ('Aimée', 'Hebert', 'Marigny-le-Châtel', 36),
 ('Marielle', 'Ribeiro', 'Maillères', 27),
 ('Hilaire', 'Savary', 'Conie-Molitard', 58);

Example 2: Insert mysql

#Some columns or all 
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
#All columns
INSERT INTO table_name
VALUES (value1, value2, value3, ...);

Example 3: mysql insert

INSERT INTO table1 (col1, col2) VALUES (3, 'A string');
INSERT INTO table1 (col1) VALUES (3);			-- col2 will be NULL if allowed
INSERT INTO table1 VALUES (3, 'A string');     	-- all table1 columns
INSERT INTO table1 (col1, col2) SELECT value3, value1 FROM table2;

Example 4: insert query in sql

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

Tags:

Sql Example