Name the columns, then give values in the same order: INSERT INTO Customers (CustomerName, City, Country) VALUES ('New Shop', 'Multan', 'Pakistan');
Columns you leave out get NULL or their default value.
Insert several rows at once by separating value lists with commas.
The sample database is rebuilt on every run, so your changes are never permanent here. Experiment freely!
💡 Key Takeaways: SQL INSERT INTO
Mastering SQL INSERT INTO helps you write clean and reliable SQL code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
SQL INSERT INTO Code Example
SQL
INSERT INTO Customers (CustomerName, ContactName, City, Country)
VALUES ('Multan Mobiles', 'Zain Ali', 'Multan', 'Pakistan'),
('Quetta Carpets', 'Gul Khan', 'Quetta', 'Pakistan');
SELECT * FROM Customers ORDER BY CustomerID DESC LIMIT 3;