SQL Database Data Change Operations (Insert, Update, Delete) Quiz
A 75-question quiz on INSERT, UPDATE, and DELETE operations, exploring values, safety rules, filtering, and practical modification patterns.
Question 1
When adding a new row, which keyword begins the operation?
Question 2
If a table has a column with a default value, what happens when you omit it in an INSERT?
Question 3
If you want only certain columns to receive values, you typically:
Question 4
Imagine collecting registrations for an event. Each time a new attendee signs up, which operation records their data as a new row?
Question 5
Why is the order of values in an INSERT important when no column list is provided?
Question 6
If you want to add several rows at once, which INSERT approach helps reduce repetitive commands?
Question 7
You are adding product records for a catalog. Which method avoids inserting unnecessary NULLs?
Question 8
INSERTing a row without specifying a NOT NULL column results in:
Question 9
What happens when you INSERT a value into a unique key column that already exists?
Question 10
Inserting rows with mismatched column/value counts typically:
Question 11
What does this command do?
INSERT INTO users (name, age) VALUES ('Mila', 27);Question 12
Interpret this INSERT:
INSERT INTO books VALUES (101, 'Atlas Guide', 19.99);Question 13
This command inserts two rows at once:
INSERT INTO tags (label) VALUES ('blue'), ('green');Question 14
What is inserted?
INSERT INTO inventory (item, quantity) VALUES ('Brush', 0);Question 15
What does this produce?
INSERT INTO logs (event, created_at) VALUES ('login', NOW());Question 16
What will this do?
INSERT INTO scores (player, score) VALUES ('Tom', score + 10);Question 17
Evaluate this:
INSERT INTO guests (name) SELECT user_name FROM applicants;Question 18
Which value is inserted?
INSERT INTO payments (amount) VALUES (NULL);Question 19
What happens here?
INSERT INTO cities (name, population) VALUES ('Paris');Question 20
Interpret this multi-value pattern:
INSERT INTO metrics (type, value) VALUES ('views', 100), ('clicks', 12);Question 21
Predict the result:
INSERT INTO actors (id, name) VALUES (5, 'Nia');Question 22
Look at this INSERT:
INSERT INTO comments (text, created_at) VALUES ('Hello', DEFAULT);Question 23
Interpret the source of inserted rows:
INSERT INTO archive_logs SELECT * FROM logs WHERE severity = 'high';Question 24
Evaluate this INSERT structure:
INSERT INTO tmp_sessions (session_id) VALUES ('xyz'), ('abc'), ('lmn');Question 25
What type of insertion is shown?
INSERT INTO audit (event) SELECT action FROM activity;Question 26
Which operation changes values in existing rows?
Question 27
Why is the WHERE clause critical in UPDATE?
Question 28
Imagine adjusting prices during a sale. Updating all products to 10% off requires:
Question 29
When updating multiple columns, SET:
Question 30
If your UPDATE affects zero rows, it usually means:
Question 31
Why might an UPDATE adjust a timestamp using NOW()?
Question 32
Updating rows without a WHERE clause is usually considered:
Question 33
Imagine marking a user account as inactive. Which operation suits this?
Question 34
Which statement best describes UPDATE?
Question 35
Updating with expressions like SET count = count + 1 is commonly used to:
Question 36
What changes here?
UPDATE users SET active = 0 WHERE last_login < '2023-01-01';Question 37
Interpret this:
UPDATE products SET price = price * 1.05;Question 38
What happens?
UPDATE employees SET dept = 'Sales' WHERE id = 4;Question 39
What is modified?
UPDATE tasks SET completed_at = NOW() WHERE completed = 1;Question 40
Interpret the result:
UPDATE accounts SET balance = balance - 50 WHERE id = 10;Question 41
What does this change?
UPDATE messages SET seen = 1 WHERE user_id = 8;Question 42
What is updated?
UPDATE books SET stock = 0 WHERE stock < 0;Question 43
Predict the update:
UPDATE tickets SET priority = 'high' WHERE urgent = 1;Question 44
What is changed?
UPDATE settings SET value = 'on' WHERE key = 'notifications';Question 45
Interpret this change:
UPDATE students SET grade = grade + 1 WHERE grade < 90;Question 46
What happens?
UPDATE cards SET expired = 1 WHERE expires_at < NOW();Question 47
Analyze this:
UPDATE reports SET reviewed_by = 'Admin' WHERE reviewed_by IS NULL;Question 48
What does this do?
UPDATE drivers SET city = 'LA' WHERE city = 'Los Angeles';Question 49
Interpret this:
UPDATE activity SET count = 0 WHERE count IS NULL;Question 50
What is updated?
UPDATE articles SET views = views + 10;Question 51
Which command removes rows?
Question 52
Why is WHERE essential in DELETE?
Question 53
Imagine cleaning old system logs. Removing only logs older than 30 days requires:
Question 54
What happens if a DELETE matches no rows?
Question 55
Deleting without WHERE generally:
Question 56
DELETE differs from UPDATE because DELETE:
Question 57
Imagine a user requests account removal. Which operation removes that user's record completely?
Question 58
DELETE operations require caution because:
Question 59
Using DELETE to clean temporary data is common because:
Question 60
DELETE without filtering is similar to:
Question 61
What rows are removed?
DELETE FROM logs WHERE level = 'debug';Question 62
Interpret this:
DELETE FROM customers WHERE inactive = 1;Question 63
What is removed?
DELETE FROM posts WHERE created_at < '2022-01-01';Question 64
What happens?
DELETE FROM events WHERE id = 7;Question 65
Which rows disappear?
DELETE FROM reviews WHERE rating = 1 OR flagged = 1;Question 66
Interpret this removal:
DELETE FROM queue WHERE attempts > 3;Question 67
What does this delete?
DELETE FROM orders WHERE status = 'cancelled';Question 68
Evaluate this deletion:
DELETE FROM students WHERE grade < 60;Question 69
Predict the effect:
DELETE FROM store_items WHERE discontinued = 1;Question 70
Which rows get deleted?
DELETE FROM sessions WHERE active = 0 AND expires_at < NOW();Question 71
What is removed?
DELETE FROM accounts WHERE last_active IS NULL;Question 72
Interpret this deletion:
DELETE FROM payments WHERE amount = 0;Question 73
What happens?
DELETE FROM audit WHERE created_at > NOW();Question 74
Which rows disappear?
DELETE FROM leads WHERE source LIKE '%test%';Question 75
What gets deleted here?
DELETE FROM accounts WHERE status IN ('blocked','fraud');