Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: the john mardon included in steam buggy mintage had a bricklin sv - 1 theme

Table: royal canadian mint numismatic coins (2000s)

year theme artist mintage issue_price
2000 steam buggy john mardon 44367 59.95
2000 the bluenose j franklin wright included in steam buggy 59.95
2000 the toronto john mardon included in steam buggy 59.95
2001 the russell light four john mardon 41828 59.95
2001 the marco polo j franklin wright included in the russell 59.95
2001 the scotia don curley included in the russell 59.95
2002 the gray - dort john mardon 35944 59.95
2002 the william lawrence bonnie ross included in the gray - dort 59.95
2002 d - 10 locomotive dan fell included in the gray - dort 59.95
2003 hmcs bras dor don curley 31997 59.95
2003 cnr fa - 1 diesel electric john mardon included in hmcs bras dor 59.95
2003 bricklin sv - 1 brian hughes included in hmcs bras dor 59.95
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'artist' is 'john mardon'.

Step 2: Select rows where 'theme' is 'steam buggy'.

Step 3: Select rows where 'mintage' is included in the mintage of 'steam buggy'.

Step 4: Select rows where 'theme' is 'bricklin sv - 1'.

Step 5: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.

Step 1: Select rows where 'artist' is 'john mardon'.

SQL command for the step:

SELECT * FROM table_sql WHERE artist = 'john mardon';
year theme artist mintage issue_price
2000 steam buggy john mardon 44367 59.95
2000 the bluenose j franklin wright included in steam buggy 59.95
2000 the toronto john mardon included in steam buggy 59.95
2001 the russell light four john mardon 41828 59.95
2001 the marco polo j franklin wright included in the russell 59.95
2001 the scotia don curley included in the russell 59.95
2002 the gray - dort john mardon 35944 59.95
2002 the william lawrence bonnie ross included in the gray - dort 59.95
2002 d - 10 locomotive dan fell included in the gray - dort 59.95
2003 hmcs bras dor don curley 31997 59.95
2003 cnr fa - 1 diesel electric john mardon included in hmcs bras dor 59.95
2003 bricklin sv - 1 brian hughes included in hmcs bras dor 59.95

Step 2: Select rows where 'theme' is 'steam buggy'.

SQL command for the step:

SELECT * FROM table_sql WHERE theme = 'steam buggy';
year theme artist mintage issue_price
2000 steam buggy john mardon 44367 59.95
2000 the toronto john mardon included in steam buggy 59.95
2001 the russell light four john mardon 41828 59.95
2002 the gray - dort john mardon 35944 59.95
2003 cnr fa - 1 diesel electric john mardon included in hmcs bras dor 59.95

Step 3: Select rows where 'mintage' is included in the mintage of 'steam buggy'.

SQL command for the step:

SELECT * FROM table_sql WHERE mintage IN (SELECT mintage FROM table_sql WHERE item = 'steam buggy');
year theme artist mintage issue_price
2000 steam buggy john mardon 44367 59.95

Step 4: Select rows where 'theme' is 'bricklin sv - 1'.

SQL command for the step:

SELECT * FROM table_sql WHERE theme = 'bricklin sv - 1';
year theme artist mintage issue_price included_in_steam_buggy
2000 steam buggy john mardon 44367 59.95 TRUE

Step 5: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.

SQL command for the step:

SELECT CASE WHEN COUNT(*) = 1 THEN TRUE ELSE FALSE END AS verification FROM table_sql;
year theme artist mintage issue_price included_in_steam_buggy

Verification:

The statement is FALSE