Standard SQL INSERT/SELECT with MySQL conveniences: multi-row INSERT, INSERT … SELECT, and strict mode behavior.
Inserts
INSERT INTO products (sku, name, price) VALUES ('C3', 'Adapter', 5.99);
INSERT INTO products (sku, name, price) VALUES
('D4', 'Part', 1.00),
('E5', 'Part', 2.00);Practice: Run on database practice in mysql client.
Select filters
SELECT id, sku, price FROM products WHERE price >= 10 ORDER BY price DESC LIMIT 5;
SQL mode
ONLY_FULL_GROUP_BY rejects invalid GROUP BY—enable in dev to match production strictness.
Important interview questions and answers
- Q: Multi-row INSERT benefit?
A: Fewer round trips than many single-row inserts. - Q: ORDER BY without LIMIT?
A: Fine on small tables; dangerous on huge tables in exploration.
Self-check
- Write INSERT for two rows at once.
- Filter products with price at least 10.
Tip: Enable ONLY_FULL_GROUP_BY in dev to match MySQL 8 defaults.
Interview prep
- Multi-row INSERT?
One statement, many value tuples—fewer round trips.
- ONLY_FULL_GROUP_BY?
Rejects invalid GROUP BY selects in strict mode.