Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: the winner of the miyagi tv cup dunlop ladies open had a 3 - stroke margin of victory

Table: ai miyazato

no date tournament winning_score to_par margin_of_victory runner__s____up
1 2003-09-28 miyagi tv cup dunlop ladies open (as an amateur ) 70 + 70 + 71 = 211 - 5 1 stroke mari katayama hiroko yamaguchi
2 2004-03-07 daikin orchid ladies 70 + 66 + 70 = 206 - 10 3 strokes kaori higo
3 2004-06-13 suntory ladies open 69 + 70 + 70 + 68 = 277 - 11 6 strokes hiroko yamaguchi toshimi kimura
4 2004-06-20 apita circle k sunkus ladies 69 + 69 + 72 = 210 - 6 1 stroke yuri fudoh
5 2004-10-24 masters gc ladies 69 + 68 + 68 = 205 - 11 1 stroke miho koga
6 2004-11-21 daio paper elleair ladies open 66 + 67 + 69 = 202 - 14 3 strokes chieko amanuma rui kitada
7 2005-05-15 vernal ladies 69 + 64 + 70 = 203 - 13 8 strokes akiko fukushima
8 2005-05-22 chukyo tv bridgestone ladies open 65 + 74 + 70 = 209 - 7 playoff nikki campbell
9 2005-08-21 new catapillar mitsubishi ladies 66 + 75 + 68 = 209 - 10 3 strokes mi - jeong jeon hiromi mogi
10 2005-10-02 japan women 's open golf championship 69 + 69 + 72 + 73 = 283 - 5 5 strokes akiko fukushima
12 2005-11-20 daio paper elleair ladies open 69 + 70 + 65 = 204 - 12 5 strokes shiho oyama woo - soon ko kasumi fujii
13 2006-09-10 jlpga championship konica minolta cup 70 + 68 + 74 + 70 = 282 - 6 3 strokes hyun - ju shin
14 2006-09-24 miyagi tv cup dunlop ladies open 70 + 73 + 71 = 214 - 2 3 strokes shiho oyama
Generating plan to answer the query...

Generated steps

Step 1: Order the table by 'margin_of_victory' in descending order.

Step 2: Select row number 1.

Step 3: Select rows where 'tournament' is 'miyagi tv cup dunlop ladies open'.

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

Step 1: Order the table by 'margin_of_victory' in descending order.

SQL command for the step:

SELECT * FROM table_sql ORDER BY margin_of_victory DESC;
no date tournament winning_score to_par margin_of_victory runner__s____up
1 2003-09-28 miyagi tv cup dunlop ladies open (as an amateur ) 70 + 70 + 71 = 211 - 5 1 stroke mari katayama hiroko yamaguchi
2 2004-03-07 daikin orchid ladies 70 + 66 + 70 = 206 - 10 3 strokes kaori higo
3 2004-06-13 suntory ladies open 69 + 70 + 70 + 68 = 277 - 11 6 strokes hiroko yamaguchi toshimi kimura
4 2004-06-20 apita circle k sunkus ladies 69 + 69 + 72 = 210 - 6 1 stroke yuri fudoh
5 2004-10-24 masters gc ladies 69 + 68 + 68 = 205 - 11 1 stroke miho koga
6 2004-11-21 daio paper elleair ladies open 66 + 67 + 69 = 202 - 14 3 strokes chieko amanuma rui kitada
7 2005-05-15 vernal ladies 69 + 64 + 70 = 203 - 13 8 strokes akiko fukushima
8 2005-05-22 chukyo tv bridgestone ladies open 65 + 74 + 70 = 209 - 7 playoff nikki campbell
9 2005-08-21 new catapillar mitsubishi ladies 66 + 75 + 68 = 209 - 10 3 strokes mi - jeong jeon hiromi mogi
10 2005-10-02 japan women 's open golf championship 69 + 69 + 72 + 73 = 283 - 5 5 strokes akiko fukushima
12 2005-11-20 daio paper elleair ladies open 69 + 70 + 65 = 204 - 12 5 strokes shiho oyama woo - soon ko kasumi fujii
13 2006-09-10 jlpga championship konica minolta cup 70 + 68 + 74 + 70 = 282 - 6 3 strokes hyun - ju shin
14 2006-09-24 miyagi tv cup dunlop ladies open 70 + 73 + 71 = 214 - 2 3 strokes shiho oyama

Step 2: Select row number 1.

SQL command for the step:

SELECT * FROM table_sql LIMIT 1;
no date tournament winning_score to_par margin_of_victory runner__s____up margin_of_victory_num
7 2005-05-15 vernal ladies 69 + 64 + 70 = 203 - 13 8 strokes akiko fukushima 8
3 2004-06-13 suntory ladies open 69 + 70 + 70 + 68 = 277 - 11 6 strokes hiroko yamaguchi toshimi kimura 6
10 2005-10-02 japan women 's open golf championship 69 + 69 + 72 + 73 = 283 - 5 5 strokes akiko fukushima 5
12 2005-11-20 daio paper elleair ladies open 69 + 70 + 65 = 204 - 12 5 strokes shiho oyama woo - soon ko kasumi fujii 5
2 2004-03-07 daikin orchid ladies 70 + 66 + 70 = 206 - 10 3 strokes kaori higo 3
6 2004-11-21 daio paper elleair ladies open 66 + 67 + 69 = 202 - 14 3 strokes chieko amanuma rui kitada 3
9 2005-08-21 new catapillar mitsubishi ladies 66 + 75 + 68 = 209 - 10 3 strokes mi - jeong jeon hiromi mogi 3
13 2006-09-10 jlpga championship konica minolta cup 70 + 68 + 74 + 70 = 282 - 6 3 strokes hyun - ju shin 3
14 2006-09-24 miyagi tv cup dunlop ladies open 70 + 73 + 71 = 214 - 2 3 strokes shiho oyama 3
1 2003-09-28 miyagi tv cup dunlop ladies open (as an amateur ) 70 + 70 + 71 = 211 - 5 1 stroke mari katayama hiroko yamaguchi 1
4 2004-06-20 apita circle k sunkus ladies 69 + 69 + 72 = 210 - 6 1 stroke yuri fudoh 1
5 2004-10-24 masters gc ladies 69 + 68 + 68 = 205 - 11 1 stroke miho koga 1
8 2005-05-22 chukyo tv bridgestone ladies open 65 + 74 + 70 = 209 - 7 playoff nikki campbell 0

Step 3: Select rows where 'tournament' is 'miyagi tv cup dunlop ladies open'.

SQL command for the step:

SELECT * FROM table_sql WHERE tournament = 'miyagi tv cup dunlop ladies open';
no date tournament winning_score to_par margin_of_victory runner__s____up margin_of_victory_num
7 2005-05-15 vernal ladies 69 + 64 + 70 = 203 - 13 8 strokes akiko fukushima 8

Step 4: 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;
no date tournament winning_score to_par margin_of_victory runner__s____up margin_of_victory_num

Verification:

The statement is FALSE