Plan-of-SQLs Interface FN

Task: Verify the Statement against the Table

Statement: after 1985 , the united states contributed four players with louis amundson being the most recent

Table: utah jazz all - time roster

player nationality position years_for_jazz school___club_team
rick adelman united states guard 1974-01-01 loyola (ca)
john amaechi england center / forward 2001-03-01 penn state
louis amundson united states forward 2007-01-01 unlv
j j anderson united states forward 1982-01-01 bradley
shandon anderson united states guard / forward 9999-01-01 georgia
rafael araãjo brazil center 2006-01-01 byu
carlos arroyo puerto rico guard 2002-05-01 florida international
isaac austin united states center 1991-01-01 arizona state
anthony avent united states forward 1998-01-01 seton hall
Generating plan to answer the query...

Generated steps

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

Step 2: Select rows where 'nationality' is 'united states'.

Step 3: Select rows where 'years_for_jazz' is after 1985.

Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 4 and 'player' is 'louis amundson', otherwise return FALSE.

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

SQL command for the step:

SELECT * FROM table_sql ORDER BY years_for_jazz DESC;
player nationality position years_for_jazz school___club_team
rick adelman united states guard 1974-01-01 loyola (ca)
john amaechi england center / forward 2001-03-01 penn state
louis amundson united states forward 2007-01-01 unlv
j j anderson united states forward 1982-01-01 bradley
shandon anderson united states guard / forward 9999-01-01 georgia
rafael araãjo brazil center 2006-01-01 byu
carlos arroyo puerto rico guard 2002-05-01 florida international
isaac austin united states center 1991-01-01 arizona state
anthony avent united states forward 1998-01-01 seton hall

Step 2: Select rows where 'nationality' is 'united states'.

SQL command for the step:

SELECT * FROM table_sql WHERE nationality = 'united states';
player nationality position years_for_jazz school___club_team
shandon anderson united states guard / forward 9999-01-01 georgia
louis amundson united states forward 2007-01-01 unlv
rafael araãjo brazil center 2006-01-01 byu
carlos arroyo puerto rico guard 2002-05-01 florida international
john amaechi england center / forward 2001-03-01 penn state
anthony avent united states forward 1998-01-01 seton hall
isaac austin united states center 1991-01-01 arizona state
j j anderson united states forward 1982-01-01 bradley
rick adelman united states guard 1974-01-01 loyola (ca)

Step 3: Select rows where 'years_for_jazz' is after 1985.

SQL command for the step:

SELECT * FROM table_sql WHERE years_for_jazz > 1985;
player nationality position years_for_jazz school___club_team
shandon anderson united states guard / forward 9999-01-01 georgia
louis amundson united states forward 2007-01-01 unlv
anthony avent united states forward 1998-01-01 seton hall
isaac austin united states center 1991-01-01 arizona state
j j anderson united states forward 1982-01-01 bradley
rick adelman united states guard 1974-01-01 loyola (ca)

Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 4 and 'player' is 'louis amundson', otherwise return FALSE.

SQL command for the step:

SELECT CASE WHEN COUNT(*) = 4 AND player = 'louis amundson' THEN TRUE ELSE FALSE END AS verification FROM table_sql;
player nationality position years_for_jazz school___club_team
shandon anderson united states guard / forward 9999-01-01 georgia
louis amundson united states forward 2007-01-01 unlv
anthony avent united states forward 1998-01-01 seton hall
isaac austin united states center 1991-01-01 arizona state

Verification:

The statement is FALSE