Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: on june 16th , jeff gordon was the driver in a ford for hendrick motorsports

Table: pocono 400

year date driver team manufacturer laps _ race_time average_speed__mph_ report
1982-01-01 9999-06-06 bobby allison digard motorsports buick 200 500 (804.672) 4:24:08 113.579 report
1983-01-01 9999-06-12 bobby allison digard motorsports buick 200 500 (804.672) 3:53:13 128.636 report
1984-01-01 9999-06-10 cale yarborough ranier - lundy chevrolet 200 500 (804.672) 3:37:08 138.164 report
1985-01-01 9999-06-09 bill elliott melling racing ford 200 500 (804.672) 3:35:48 138.974 report
1986-01-01 9999-06-08 tim richmond hendrick motorsports chevrolet 200 500 (804.672) 4:24:50 113.279 report
1987-01-01 9999-06-14 tim richmond hendrick motorsports chevrolet 200 500 (804.672) 4:05:57 122.166 report
1988-01-01 9999-06-19 geoffrey bodine hendrick motorsports chevrolet 200 500 (804.672) 3:58:21 126.147 report
1989-01-01 9999-06-18 terry labonte junior johnson & associates ford 200 500 (804.672) 3:48:27 131.32 report
1990-01-01 9999-06-17 harry gant leo jackson racing oldsmobile 200 500 (804.672) 4:08:25 120.6 report
1991-01-01 9999-06-16 darrell waltrip darwal , inc chevrolet 200 500 (804.672) 4:04:34 122.666 report
1992-01-01 9999-06-14 alan kulwicki ak racing ford 200 500 (804.672) 3:28:18 144.023 report
1993-01-01 9999-06-13 kyle petty sabco racing pontiac 200 500 (804.672) 3:37:23 138.005 report
1994-01-01 9999-06-12 rusty wallace penske racing ford 200 500 (804.672) 3:52:55 128.801 report
1995-01-01 9999-06-11 terry labonte hendrick motorsports chevrolet 200 500 (804.672) 3:37:50 137.72 report
1996-01-01 9999-06-16 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:35:40 139.104 report
1997-01-01 9999-06-08 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:34:33 139.828 report
1998-01-01 9999-06-21 jeremy mayfield penske racing ford 200 500 (804.672) 4:14:39 117.809 report
1999-01-01 9999-06-20 bobby labonte joe gibbs racing pontiac 200 500 (804.672) 4:12:19 118.898 report
2000-01-01 9999-06-19 jeremy mayfield penske racing ford 200 500 (804.672) 3:34:41 139.741 report
2001-01-01 9999-06-17 ricky rudd robert yates racing ford 200 500 (804.672) 3:43:14 134.389 report
2002-01-01 9999-06-09 dale jarrett robert yates racing ford 200 500 (804.672) 3:29:10 143.426 report
2003-01-01 9999-06-08 tony stewart joe gibbs racing chevrolet 200 500 (804.672) 3:42:24 134.892 report
2004-01-01 9999-06-13 jimmie johnson hendrick motorsports chevrolet 200 500 (804.672) 4:27:33 112.129 report
2005-01-01 9999-06-12 carl edwards roush racing ford 201 502.5 (808.695) 3:53:24 129.177 report
2006-01-01 9999-06-11 denny hamlin joe gibbs racing chevrolet 200 500 (804.672) 3:47:52 131.656 report
2007-01-01 9999-06-10 jeff gordon hendrick motorsports chevrolet 106 265 (426.476) 1:57:15 135.608 report
2008-01-01 9999-06-08 kasey kahne gillett evernham motorsports dodge 200 500 (804.672) 3:59:36 125.209 report
2009-01-01 9999-06-07 tony stewart stewart - haas racing chevrolet 200 500 (804.672) 3:36:35 138.515 report
2010-01-01 9999-06-06 denny hamlin joe gibbs racing toyota 204 510 (820.765) 3:44:30 136.303 report
2011-01-01 9999-06-12 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:26:21 145.384 report
2012-01-01 9999-06-10 joey logano joe gibbs racing toyota 160 400 (643.737) 3:03:12 131.004 report
Generating plan to answer the query...

Generated steps

Step 1: Select rows where the 'date' is '9999-06-16'.

Step 2: Select rows where the 'driver' is 'jeff gordon'.

Step 3: Select rows where the 'team' is 'hendrick motorsports'.

Step 4: Select rows where the 'manufacturer' is 'ford'.

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 the 'date' is '9999-06-16'.

SQL command for the step:

SELECT * FROM table_sql WHERE date = '9999-06-16';
year date driver team manufacturer laps _ race_time average_speed__mph_ report
1982-01-01 9999-06-06 bobby allison digard motorsports buick 200 500 (804.672) 4:24:08 113.579 report
1983-01-01 9999-06-12 bobby allison digard motorsports buick 200 500 (804.672) 3:53:13 128.636 report
1984-01-01 9999-06-10 cale yarborough ranier - lundy chevrolet 200 500 (804.672) 3:37:08 138.164 report
1985-01-01 9999-06-09 bill elliott melling racing ford 200 500 (804.672) 3:35:48 138.974 report
1986-01-01 9999-06-08 tim richmond hendrick motorsports chevrolet 200 500 (804.672) 4:24:50 113.279 report
1987-01-01 9999-06-14 tim richmond hendrick motorsports chevrolet 200 500 (804.672) 4:05:57 122.166 report
1988-01-01 9999-06-19 geoffrey bodine hendrick motorsports chevrolet 200 500 (804.672) 3:58:21 126.147 report
1989-01-01 9999-06-18 terry labonte junior johnson & associates ford 200 500 (804.672) 3:48:27 131.32 report
1990-01-01 9999-06-17 harry gant leo jackson racing oldsmobile 200 500 (804.672) 4:08:25 120.6 report
1991-01-01 9999-06-16 darrell waltrip darwal , inc chevrolet 200 500 (804.672) 4:04:34 122.666 report
1992-01-01 9999-06-14 alan kulwicki ak racing ford 200 500 (804.672) 3:28:18 144.023 report
1993-01-01 9999-06-13 kyle petty sabco racing pontiac 200 500 (804.672) 3:37:23 138.005 report
1994-01-01 9999-06-12 rusty wallace penske racing ford 200 500 (804.672) 3:52:55 128.801 report
1995-01-01 9999-06-11 terry labonte hendrick motorsports chevrolet 200 500 (804.672) 3:37:50 137.72 report
1996-01-01 9999-06-16 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:35:40 139.104 report
1997-01-01 9999-06-08 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:34:33 139.828 report
1998-01-01 9999-06-21 jeremy mayfield penske racing ford 200 500 (804.672) 4:14:39 117.809 report
1999-01-01 9999-06-20 bobby labonte joe gibbs racing pontiac 200 500 (804.672) 4:12:19 118.898 report
2000-01-01 9999-06-19 jeremy mayfield penske racing ford 200 500 (804.672) 3:34:41 139.741 report
2001-01-01 9999-06-17 ricky rudd robert yates racing ford 200 500 (804.672) 3:43:14 134.389 report
2002-01-01 9999-06-09 dale jarrett robert yates racing ford 200 500 (804.672) 3:29:10 143.426 report
2003-01-01 9999-06-08 tony stewart joe gibbs racing chevrolet 200 500 (804.672) 3:42:24 134.892 report
2004-01-01 9999-06-13 jimmie johnson hendrick motorsports chevrolet 200 500 (804.672) 4:27:33 112.129 report
2005-01-01 9999-06-12 carl edwards roush racing ford 201 502.5 (808.695) 3:53:24 129.177 report
2006-01-01 9999-06-11 denny hamlin joe gibbs racing chevrolet 200 500 (804.672) 3:47:52 131.656 report
2007-01-01 9999-06-10 jeff gordon hendrick motorsports chevrolet 106 265 (426.476) 1:57:15 135.608 report
2008-01-01 9999-06-08 kasey kahne gillett evernham motorsports dodge 200 500 (804.672) 3:59:36 125.209 report
2009-01-01 9999-06-07 tony stewart stewart - haas racing chevrolet 200 500 (804.672) 3:36:35 138.515 report
2010-01-01 9999-06-06 denny hamlin joe gibbs racing toyota 204 510 (820.765) 3:44:30 136.303 report
2011-01-01 9999-06-12 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:26:21 145.384 report
2012-01-01 9999-06-10 joey logano joe gibbs racing toyota 160 400 (643.737) 3:03:12 131.004 report

Step 2: Select rows where the 'driver' is 'jeff gordon'.

SQL command for the step:

SELECT * FROM table_sql WHERE driver = 'jeff gordon';
year date driver team manufacturer laps _ race_time average_speed__mph_ report
1991-01-01 9999-06-16 darrell waltrip darwal , inc chevrolet 200 500 (804.672) 4:04:34 122.666 report
1996-01-01 9999-06-16 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:35:40 139.104 report

Step 3: Select rows where the 'team' is 'hendrick motorsports'.

SQL command for the step:

SELECT * FROM table_sql WHERE team = 'hendrick motorsports';
year date driver team manufacturer laps _ race_time average_speed__mph_ report
1996-01-01 9999-06-16 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:35:40 139.104 report

Step 4: Select rows where the 'manufacturer' is 'ford'.

SQL command for the step:

SELECT * FROM table_sql WHERE manufacturer = 'ford';
year date driver team manufacturer laps _ race_time average_speed__mph_ report
1996-01-01 9999-06-16 jeff gordon hendrick motorsports chevrolet 200 500 (804.672) 3:35:40 139.104 report

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 date driver team manufacturer laps _ race_time average_speed__mph_ report

Verification:

The statement is FALSE