Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: steve stricker of of scotland had lower score than of phil mickelson of united states

Table: 2006 u.s. open (golf)

place player country score to_par
1 steve stricker united states 70 + 69 = 139 - 1
2 colin montgomerie scotland 69 + 71 = 140 e
t3 kenneth ferrie england 71 + 70 = 141 + 1
t3 geoff ogilvy australia 71 + 70 = 141 + 1
t5 jim furyk united states 70 + 72 = 142 + 2
t5 pádraig harrington ireland 70 + 72 = 142 + 2
t7 jason dufner united states 72 + 71 = 143 + 3
t7 graeme mcdowell northern ireland 71 + 72 = 143 + 3
t7 phil mickelson united states 70 + 73 = 143 + 3
t7 arron oberholser united states 75 + 68 = 143 + 3
Generating plan to answer the query...

Generated steps

Step 1: Order the table by 'score' in ascending order.

Step 2: Select rows where 'player' is 'steve stricker' and 'country' is 'scotland'.

Step 3: Select rows where 'player' is 'phil mickelson' and 'country' is 'united states'.

Step 4: Use a `CASE` statement to return TRUE if the score of Steve Stricker is lower than the score of Phil Mickelson, otherwise return FALSE.

Step 1: Order the table by 'score' in ascending order.

SQL command for the step:

SELECT * FROM table_sql ORDER BY score ASC;
place player country score to_par
1 steve stricker united states 70 + 69 = 139 - 1
2 colin montgomerie scotland 69 + 71 = 140 e
t3 kenneth ferrie england 71 + 70 = 141 + 1
t3 geoff ogilvy australia 71 + 70 = 141 + 1
t5 jim furyk united states 70 + 72 = 142 + 2
t5 pádraig harrington ireland 70 + 72 = 142 + 2
t7 jason dufner united states 72 + 71 = 143 + 3
t7 graeme mcdowell northern ireland 71 + 72 = 143 + 3
t7 phil mickelson united states 70 + 73 = 143 + 3
t7 arron oberholser united states 75 + 68 = 143 + 3

Step 2: Select rows where 'player' is 'steve stricker' and 'country' is 'scotland'.

SQL command for the step:

SELECT * FROM table_sql WHERE player = 'steve stricker' AND country = 'scotland';
place player country score to_par
1 steve stricker united states 70 + 69 = 139 - 1
2 colin montgomerie scotland 69 + 71 = 140 e
t3 kenneth ferrie england 71 + 70 = 141 + 1
t3 geoff ogilvy australia 71 + 70 = 141 + 1
t5 jim furyk united states 70 + 72 = 142 + 2
t5 pádraig harrington ireland 70 + 72 = 142 + 2
t7 jason dufner united states 72 + 71 = 143 + 3
t7 graeme mcdowell northern ireland 71 + 72 = 143 + 3
t7 phil mickelson united states 70 + 73 = 143 + 3
t7 arron oberholser united states 75 + 68 = 143 + 3

Step 3: Select rows where 'player' is 'phil mickelson' and 'country' is 'united states'.

SQL command for the step:

SELECT * FROM table_sql WHERE player = 'phil mickelson' AND country = 'united states';
place player country score to_par

Step 4: Use a `CASE` statement to return TRUE if the score of Steve Stricker is lower than the score of Phil Mickelson, otherwise return FALSE.

SQL command for the step:

SELECT CASE WHEN (SELECT score FROM table_sql WHERE player_name = 'Steve Stricker') < (SELECT score FROM table_sql WHERE player_name = 'Phil Mickelson') THEN TRUE ELSE FALSE END AS verification;
place player country score to_par

Verification:

The statement is FALSE