Tutorial by Examples

INSERT INTO Customers VALUES ('Zack', 'Smith', '[email protected]', '7049989942', 'EMAIL'); This statement will insert a new row into the Customers table. Note that a value was not specified for the Id column, as it will be added automatically. However, all other column values must be specified. ...
INSERT INTO Customers (FName, LName, Email, PreferredContact) VALUES ('Zack', 'Smith', '[email protected]', 'EMAIL'); This statement will insert a new row into the Customers table. Data will only be inserted into the columns specified - note that no value was provided for the PhoneNumber column. ...
INSERT INTO Customers (FName, LName, PhoneNumber) SELECT FName, LName, PhoneNumber FROM Employees This example will insert all Employees into the Customers table. Since the two tables have different fields and you don't want to move all the fields over, you need to set which fields to insert int...
Multiple rows can be inserted with a single insert command: INSERT INTO tbl_name (field1, field2, field3) VALUES (1,2,3), (4,5,6), (7,8,9); For inserting large quantities of data (bulk insert) at the same time, DBMS-specific features and recommendations exist. MySQL - LOAD DATA INFILE MSSQL - B...

Page 1 of 1