0
0
SQLquery~10 mins

CASCADE delete preview 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 a row from the parent table.

SQL
DELETE FROM parent_table WHERE id = [1];
Drag options to blanks, or click blank then click option'
A'10'
B10
Cid
Dparent_id
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around numeric id values.
Using column names instead of values.
2fill in blank
medium

Complete the code to preview rows in the child table that will be deleted due to CASCADE.

SQL
SELECT * FROM child_table WHERE parent_id = [1];
Drag options to blanks, or click blank then click option'
A'10'
Bparent_id
C10
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numeric values.
Using column names instead of values.
3fill in blank
hard

Fix the error in the CASCADE delete preview query.

SQL
SELECT * FROM child_table WHERE parent_id = [1];
Drag options to blanks, or click blank then click option'
A10
B'10'
C'10';
D10;
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the semicolon at the end.
Using quotes around numeric values.
4fill in blank
hard

Fill both blanks to preview and then delete rows with CASCADE.

SQL
SELECT * FROM child_table WHERE parent_id = [1];
DELETE FROM parent_table WHERE id = [2];
Drag options to blanks, or click blank then click option'
A10
B'10'
Cid
Dparent_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numeric values.
Using column names instead of values.
5fill in blank
hard

Fill all three blanks to preview child rows, delete parent row, and confirm deletion.

SQL
SELECT * FROM child_table WHERE parent_id = [1];
DELETE FROM parent_table WHERE id = [2];
SELECT * FROM child_table WHERE parent_id = [3];
Drag options to blanks, or click blank then click option'
A10
B'10'
Cid
Dparent_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numeric values.
Using column names instead of values.