xxxxxxxxxx
INSERT INTO My_Table (FirstName, LastName)
VALUES
('Fred', 'Smith'),
('John', 'Smith'),
('Michael', 'Smith'),
('Robert', 'Smith');
xxxxxxxxxx
INSERT INTO MyTable
( Column1, Column2, Column3 )
VALUES
('John', 123, 'Lloyds Office'),
('Jane', 124, 'Lloyds Office'),
('Billy', 125, 'London Office'),
('Miranda', 126, 'Bristol Office');
xxxxxxxxxx
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
(value_list_n);
xxxxxxxxxx
INSERT INTO sales.promotions (
promotion_name,
discount,
start_date,
expired_date
)
VALUES
(
'2019 Summer Promotion',
0.15,
'20190601',
'20190901'
),
(
'2019 Fall Promotion',
0.20,
'20191001',
'20191101'
),
(
'2019 Winter Promotion',
0.25,
'20191201',
'20200101'
);
Code language: SQL (Structured Query Language) (sql)
xxxxxxxxxx
INSERT INTO Pets (PetId, PetTypeId, OwnerId, PetName, DOB)
VALUES
(1, 2, 3, 'Fluffy', '2020-11-20'),
(2, 3, 3, 'Fetch', '2019-08-16'),
(3, 2, 2, 'Scratch', '2018-10-01');
xxxxxxxxxx
INSERT INTO table2
(name, email, phone)
SELECT name, email, phone
FROM table1;
xxxxxxxxxx
INSERT INTO Customers(first_name, last_name, age, country)
VALUES
('Harry', 'Potter', 31, 'USA'),
('Chris', 'Hemsworth', 43, 'USA'),
('Tom', 'Holland', 26, 'UK');
xxxxxxxxxx
INSERT INTO customer (first_name, last_name)
SELECT fname, lname
FROM list_of_customers
WHERE active = 1;
xxxxxxxxxx
INSERT INTO Pets (PetId, PetTypeId, OwnerId, PetName, DOB)
VALUES ( 1, 2, 3, 'Fluffy', '2020-11-20' );
INSERT INTO Pets (PetId, PetTypeId, OwnerId, PetName, DOB)
VALUES ( 2, 3, 3, 'Fetch', '2019-08-16' );
INSERT INTO Pets (PetId, PetTypeId, OwnerId, PetName, DOB)
VALUES ( 3, 2, 2, 'Scratch', '2018-10-01' );