SQL Database Data Change Operations (Insert, Update, Delete) Quiz

SQL Database
0 Passed
0% acceptance

A 75-question quiz on INSERT, UPDATE, and DELETE operations, exploring values, safety rules, filtering, and practical modification patterns.

75 Questions
~150 minutes
1

Question 1

When adding a new row, which keyword begins the operation?

A
INSERT
B
CHANGE
C
APPEND
D
ADDROW
2

Question 2

If a table has a column with a default value, what happens when you omit it in an INSERT?

A
The default value is used
B
The row fails to insert
C
The value becomes 0 always
D
The value becomes a duplicate key
3

Question 3

If you want only certain columns to receive values, you typically:

A
List the column names explicitly
B
Insert into all columns every time
C
Ignore column order completely
D
Use UPDATE instead
4

Question 4

Imagine collecting registrations for an event. Each time a new attendee signs up, which operation records their data as a new row?

A
INSERT
B
UPDATE
C
DELETE
D
RENAME
5

Question 5

Why is the order of values in an INSERT important when no column list is provided?

A
Values must match the table’s defined column order
B
The system guesses the correct order
C
Order determines row numbering
D
It affects sorting
6

Question 6

If you want to add several rows at once, which INSERT approach helps reduce repetitive commands?

A
Multi-row INSERT
B
DELETE
C
ALTER
D
DROP
7

Question 7

You are adding product records for a catalog. Which method avoids inserting unnecessary NULLs?

A
Specify column names explicitly
B
Insert into all columns
C
Use UPDATE first
D
Use DELETE then INSERT
8

Question 8

INSERTing a row without specifying a NOT NULL column results in:

A
An error unless a default exists
B
A silent fill with random text
C
Automatic deletion
D
Column ignored permanently
9

Question 9

What happens when you INSERT a value into a unique key column that already exists?

A
The operation fails due to uniqueness violation
B
The row is updated automatically
C
The old value is deleted
D
The system renames the key
10

Question 10

Inserting rows with mismatched column/value counts typically:

A
Triggers an error
B
Reorders columns automatically
C
Inserts only what matches
D
Creates empty rows
11

Question 11

What does this command do?

sql
INSERT INTO users (name, age) VALUES ('Mila', 27);
A
Adds a new row with name Mila and age 27
B
Changes Mila’s existing age
C
Deletes older records
D
Renames the users table
12

Question 12

Interpret this INSERT:

sql
INSERT INTO books VALUES (101, 'Atlas Guide', 19.99);
A
Adds a row using the full table order
B
Fails because column names required
C
Deletes book 101
D
Updates book 101
13

Question 13

This command inserts two rows at once:

sql
INSERT INTO tags (label) VALUES ('blue'), ('green');
A
Adds two new tag rows
B
Only adds the first row
C
Replaces existing tags
D
Creates duplicate labels automatically
14

Question 14

What is inserted?

sql
INSERT INTO inventory (item, quantity) VALUES ('Brush', 0);
A
A new item Brush with quantity 0
B
An update to existing Brush records
C
A deletion of Brush
D
A renaming of Brush to 0
15

Question 15

What does this produce?

sql
INSERT INTO logs (event, created_at) VALUES ('login', NOW());
A
A row recording a login event with current time
B
A deletion of old logs
C
A renaming of event column
D
No action
16

Question 16

What will this do?

sql
INSERT INTO scores (player, score) VALUES ('Tom', score + 10);
A
Fails unless 'score' refers to a literal value
B
Adds 10 to existing scores
C
Deletes Tom
D
Updates all scores
17

Question 17

Evaluate this:

sql
INSERT INTO guests (name) SELECT user_name FROM applicants;
A
Copies applicant names into guests
B
Deletes applicants
C
Updates guest names
D
Creates an empty table
18

Question 18

Which value is inserted?

sql
INSERT INTO payments (amount) VALUES (NULL);
A
A NULL amount
B
A zero amount
C
A negative amount
D
The last known amount
19

Question 19

What happens here?

sql
INSERT INTO cities (name, population) VALUES ('Paris');
A
Fails due to missing population value
B
Inserts default population
C
Inserts NULL silently
D
Replaces existing city
20

Question 20

Interpret this multi-value pattern:

sql
INSERT INTO metrics (type, value) VALUES ('views', 100), ('clicks', 12);
A
Adds two metric rows
B
Updates two existing rows
C
Deletes metrics
D
Creates new table
21

Question 21

Predict the result:

sql
INSERT INTO actors (id, name) VALUES (5, 'Nia');
A
Adds actor with id 5
B
Removes actor with id 5
C
Updates actor 5
D
Fails because name is too short
22

Question 22

Look at this INSERT:

sql
INSERT INTO comments (text, created_at) VALUES ('Hello', DEFAULT);
A
Uses default for created_at
B
Fails always
C
Sets created_at to NULL
D
Deletes old comments
23

Question 23

Interpret the source of inserted rows:

sql
INSERT INTO archive_logs SELECT * FROM logs WHERE severity = 'high';
A
Copies filtered logs into archive
B
Deletes severe logs only
C
Renames the logs table
D
Duplicates logs randomly
24

Question 24

Evaluate this INSERT structure:

sql
INSERT INTO tmp_sessions (session_id) VALUES ('xyz'), ('abc'), ('lmn');
A
Creates three sessions
B
Creates one session only
C
Deletes all sessions
D
Fails due to multiple values
25

Question 25

What type of insertion is shown?

sql
INSERT INTO audit (event) SELECT action FROM activity;
A
Insert based on a subquery
B
Multi-value INSERT
C
Replace operation
D
Stored procedure call
26

Question 26

Which operation changes values in existing rows?

A
UPDATE
B
INSERT
C
DROP
D
RENAME
27

Question 27

Why is the WHERE clause critical in UPDATE?

A
It prevents unintentionally modifying all rows
B
It renames columns
C
It adjusts table size
D
It controls table creation
28

Question 28

Imagine adjusting prices during a sale. Updating all products to 10% off requires:

A
UPDATE with an expression in SET
B
DELETE the old prices
C
INSERT new price rows
D
DROP the price column
29

Question 29

When updating multiple columns, SET:

A
Can list multiple assignments separated by commas
B
Only supports one column per statement
C
Deletes columns automatically
D
Sorts rows first
30

Question 30

If your UPDATE affects zero rows, it usually means:

A
No row matched the condition
B
The table was deleted
C
The system crashed
D
The query updated all rows
31

Question 31

Why might an UPDATE adjust a timestamp using NOW()?

A
To record the moment of change
B
To remove all timestamps
C
To rename the timestamp column
D
To clear historical data
32

Question 32

Updating rows without a WHERE clause is usually considered:

A
Risky
B
Optimal
C
Required
D
Preferred for safety
33

Question 33

Imagine marking a user account as inactive. Which operation suits this?

A
UPDATE with a status flag
B
DELETE the user row
C
INSERT a new user entry
D
REORDER the user table
34

Question 34

Which statement best describes UPDATE?

A
It replaces specified values in existing rows
B
It always inserts new rows
C
It deletes rows permanently
D
It renames tables
35

Question 35

Updating with expressions like SET count = count + 1 is commonly used to:

A
Increment counters safely
B
Rename columns temporarily
C
Delete outdated counters
D
Copy counters into other tables
36

Question 36

What changes here?

sql
UPDATE users SET active = 0 WHERE last_login < '2023-01-01';
A
Marks older accounts inactive
B
Deletes users
C
Renames active column
D
Inserts new users
37

Question 37

Interpret this:

sql
UPDATE products SET price = price * 1.05;
A
All prices increase by 5%
B
Only low prices change
C
Only high prices change
D
Fails due to missing WHERE
38

Question 38

What happens?

sql
UPDATE employees SET dept = 'Sales' WHERE id = 4;
A
Employee 4 is moved to Sales
B
All employees move to Sales
C
Employee 4 is deleted
D
A new employee is inserted
39

Question 39

What is modified?

sql
UPDATE tasks SET completed_at = NOW() WHERE completed = 1;
A
Completed tasks get timestamps
B
All tasks get timestamps
C
Timestamps are deleted
D
Tasks are removed
40

Question 40

Interpret the result:

sql
UPDATE accounts SET balance = balance - 50 WHERE id = 10;
A
Account 10 loses 50 units
B
All balances become zero
C
Account 10 is deleted
D
New account created
41

Question 41

What does this change?

sql
UPDATE messages SET seen = 1 WHERE user_id = 8;
A
Marks messages for user 8 as seen
B
Marks all messages as deleted
C
Renames message fields
D
Adds new messages
42

Question 42

What is updated?

sql
UPDATE books SET stock = 0 WHERE stock < 0;
A
Negative stock values corrected to zero
B
All stock set to zero
C
Books removed
D
Only new books updated
43

Question 43

Predict the update:

sql
UPDATE tickets SET priority = 'high' WHERE urgent = 1;
A
Urgent tickets become high priority
B
All tickets deleted
C
Priority column dropped
D
Only new tickets updated
44

Question 44

What is changed?

sql
UPDATE settings SET value = 'on' WHERE key = 'notifications';
A
Notification setting turned on
B
All settings turned on
C
Setting deleted
D
New setting created
45

Question 45

Interpret this change:

sql
UPDATE students SET grade = grade + 1 WHERE grade < 90;
A
Low grades get increased by 1
B
All grades become 1
C
Students deleted
D
New grade added
46

Question 46

What happens?

sql
UPDATE cards SET expired = 1 WHERE expires_at < NOW();
A
Marks expired cards
B
Deletes expired cards
C
Creates new cards
D
Resets all expiration dates
47

Question 47

Analyze this:

sql
UPDATE reports SET reviewed_by = 'Admin' WHERE reviewed_by IS NULL;
A
Unassigned reviews are assigned Admin
B
All reports deleted
C
The column is renamed
D
Only nulls removed
48

Question 48

What does this do?

sql
UPDATE drivers SET city = 'LA' WHERE city = 'Los Angeles';
A
Standardizes the city name
B
Creates a new driver
C
Deletes drivers from LA
D
Sets all cities to LA
49

Question 49

Interpret this:

sql
UPDATE activity SET count = 0 WHERE count IS NULL;
A
Replaces NULL counts with 0
B
Deletes all rows
C
Inserts 0 into new rows
D
Drops the table
50

Question 50

What is updated?

sql
UPDATE articles SET views = views + 10;
A
All articles gain 10 views
B
Only old articles updated
C
Views deleted
D
New articles inserted
51

Question 51

Which command removes rows?

A
DELETE
B
INSERT
C
UPDATE
D
RENAME
52

Question 52

Why is WHERE essential in DELETE?

A
To prevent unwanted mass deletion
B
To rename the table
C
To mark rows inactive
D
To reorder rows
53

Question 53

Imagine cleaning old system logs. Removing only logs older than 30 days requires:

A
DELETE with a date filter
B
UPDATE log dates
C
INSERT new logs
D
DROP log table
54

Question 54

What happens if a DELETE matches no rows?

A
Nothing is removed
B
Table is dropped
C
Rows are silently updated
D
Values reset to NULL
55

Question 55

Deleting without WHERE generally:

A
Removes all rows
B
Leaves table unchanged
C
Removes columns
D
Changes structure
56

Question 56

DELETE differs from UPDATE because DELETE:

A
Removes entire rows
B
Changes values only
C
Adds new rows
D
Reorders the table
57

Question 57

Imagine a user requests account removal. Which operation removes that user's record completely?

A
DELETE with id filter
B
UPDATE active flag
C
INSERT a blank record
D
Rename the user
58

Question 58

DELETE operations require caution because:

A
Removed rows cannot be recovered unless backed up
B
DELETE renames tables
C
DELETE changes column types
D
DELETE always fails on large tables
59

Question 59

Using DELETE to clean temporary data is common because:

A
It removes expired or unnecessary rows
B
It changes constraints
C
It renames columns
D
It resets table storage
60

Question 60

DELETE without filtering is similar to:

A
Clearing all data from the table
B
Creating a new table
C
Adding new data
D
Renaming columns
61

Question 61

What rows are removed?

sql
DELETE FROM logs WHERE level = 'debug';
A
Only debug logs
B
All logs
C
Error logs only
D
No logs at all
62

Question 62

Interpret this:

sql
DELETE FROM customers WHERE inactive = 1;
A
Removes inactive customers
B
Removes all customers
C
Updates inactive to 0
D
Creates a new customer
63

Question 63

What is removed?

sql
DELETE FROM posts WHERE created_at < '2022-01-01';
A
Posts older than the date
B
All posts
C
Posts newer than the date
D
Nothing is deleted
64

Question 64

What happens?

sql
DELETE FROM events WHERE id = 7;
A
Event 7 is removed
B
All events removed
C
Event renamed
D
New event added
65

Question 65

Which rows disappear?

sql
DELETE FROM reviews WHERE rating = 1 OR flagged = 1;
A
Low-rated or flagged reviews
B
Only high-rated reviews
C
No reviews
D
All reviews
66

Question 66

Interpret this removal:

sql
DELETE FROM queue WHERE attempts > 3;
A
Over-attempted tasks removed
B
All tasks removed
C
Queue reordered
D
New tasks inserted
67

Question 67

What does this delete?

sql
DELETE FROM orders WHERE status = 'cancelled';
A
Cancelled orders
B
Shipped orders
C
All orders
D
No orders
68

Question 68

Evaluate this deletion:

sql
DELETE FROM students WHERE grade < 60;
A
Students with low grades removed
B
All students removed
C
Only high-grade students remain
D
Grades updated
69

Question 69

Predict the effect:

sql
DELETE FROM store_items WHERE discontinued = 1;
A
Discontinued items removed
B
All items removed
C
Discontinued items updated
D
Table renamed
70

Question 70

Which rows get deleted?

sql
DELETE FROM sessions WHERE active = 0 AND expires_at < NOW();
A
Inactive sessions that have expired
B
Active sessions
C
All sessions
D
Only recent sessions
71

Question 71

What is removed?

sql
DELETE FROM accounts WHERE last_active IS NULL;
A
Accounts with no recorded activity
B
All accounts
C
Only recently active accounts
D
Only admin accounts
72

Question 72

Interpret this deletion:

sql
DELETE FROM payments WHERE amount = 0;
A
Zero-amount payments removed
B
All payments removed
C
Payments set to zero
D
Only unknown payments removed
73

Question 73

What happens?

sql
DELETE FROM audit WHERE created_at > NOW();
A
Future-dated audit rows removed
B
All audit rows removed
C
No rows removed
D
Audit table renamed
74

Question 74

Which rows disappear?

sql
DELETE FROM leads WHERE source LIKE '%test%';
A
Rows with 'test' in source
B
Rows starting with test only
C
All leads
D
No rows removed
75

Question 75

What gets deleted here?

sql
DELETE FROM accounts WHERE status IN ('blocked','fraud');
A
Blocked or fraudulent accounts
B
Only blocked accounts
C
Only fraudulent accounts
D
All accounts

QUIZZES IN SQL Database