0
0
SQLquery~10 mins

DELETE with WHERE condition in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to delete rows where the age is 30.

SQL
DELETE FROM users WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
A>
B!=
C<
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' deletes rows where age is not 30, which is the opposite.
Using '>' or '<' deletes rows with age greater or less than 30, not equal.
2fill in blank
medium

Complete the code to delete rows where the status is 'inactive'.

SQL
DELETE FROM accounts WHERE status [1] 'inactive';
Drag options to blanks, or click blank then click option'
A=
BLIKE
C!=
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' deletes rows where status is not 'inactive'.
Using 'IN' requires a list of values, not a single string.
3fill in blank
hard

Fix the error in the code to delete rows where score is less than 50.

SQL
DELETE FROM results WHERE score [1] 50;
Drag options to blanks, or click blank then click option'
A<=
B<
C>
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' causes a syntax error in SQL.
Using '>' deletes rows with score greater than 50, not less.
4fill in blank
hard

Fill both blanks to delete rows where the city is 'Paris' and age is greater than 25.

SQL
DELETE FROM customers WHERE city [1] 'Paris' [2] age > 25;
Drag options to blanks, or click blank then click option'
A=
B!=
CAND
DOR
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' deletes rows where city is not Paris.
Using 'OR' deletes rows where either condition is true, not both.
5fill in blank
hard

Fill all three blanks to delete rows where the product is 'Book' and quantity is less than 10.

SQL
DELETE FROM orders WHERE product [1] 'Book' [2] quantity [3] 10;
Drag options to blanks, or click blank then click option'
A=
B<
CAND
DOR
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'OR' deletes rows if any condition is true, not all.
Using '>' instead of '<' for quantity changes the condition.