Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: there are 12 t - 260 eu aircrafts currently in service

Table: uruguayan air force

aircraft origin type versions in_service
cessna a - 37 dragonfly united states attack / fighter a - 37b 12 (16 delivered)
fma ia 58 pucarã¡ argentina attack a - 58 5 (6 delivered)
lockheed c - 130 hercules united states transport / utility c - 130b 2
embraer emb 110 bandeirante brazil transport / utility c - 95 3
beechcraft twin bonanza united states transport / utility d50 1
casa c - 212 aviocar spain transport c - 212 - 200 2
embraer emb 120 brasilia brazil transport emb 120 1
cessna 206 stationair united states utility / liaison u206h 10
beechcraft b58 baron united states trainer / liaison b - 58 2
british aerospace 125 united kingdom vip transport 700a 600a 2
aermacchi sf260 italy trainer t - 260 eu 12
pilatus pc - 7 turbo trainer switzerland trainer - 92 5 (6 delivered)
cessna t - 41 mescalero united states trainer t - 41d 7
aerospatiale as 365 dauphin france liaison / transport as 365 1
bell 212 twin huey united states transport / utility bell 212 4
bell uh - 1 iroquois united states transport / utility uh - 1h 13
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'versions' is 't - 260 eu'.

Step 2: Extract the numerical value from the 'in_service' column then add column 'num_in_service' to existing table.

Step 3: Select rows where 'num_in_service' is 12.

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

Step 1: Select rows where 'versions' is 't - 260 eu'.

SQL command for the step:

SELECT * FROM table_sql WHERE versions = 't - 260 eu';
aircraft origin type versions in_service
cessna a - 37 dragonfly united states attack / fighter a - 37b 12 (16 delivered)
fma ia 58 pucarã¡ argentina attack a - 58 5 (6 delivered)
lockheed c - 130 hercules united states transport / utility c - 130b 2
embraer emb 110 bandeirante brazil transport / utility c - 95 3
beechcraft twin bonanza united states transport / utility d50 1
casa c - 212 aviocar spain transport c - 212 - 200 2
embraer emb 120 brasilia brazil transport emb 120 1
cessna 206 stationair united states utility / liaison u206h 10
beechcraft b58 baron united states trainer / liaison b - 58 2
british aerospace 125 united kingdom vip transport 700a 600a 2
aermacchi sf260 italy trainer t - 260 eu 12
pilatus pc - 7 turbo trainer switzerland trainer - 92 5 (6 delivered)
cessna t - 41 mescalero united states trainer t - 41d 7
aerospatiale as 365 dauphin france liaison / transport as 365 1
bell 212 twin huey united states transport / utility bell 212 4
bell uh - 1 iroquois united states transport / utility uh - 1h 13

Step 2: Extract the numerical value from the 'in_service' column then add column 'num_in_service' to existing table.

SQL command for the step:

ALTER TABLE table_sql ADD COLUMN num_in_service INT GENERATED ALWAYS AS (CAST(in_service AS INT)) STORED;
aircraft origin type versions in_service
aermacchi sf260 italy trainer t - 260 eu 12

Step 3: Select rows where 'num_in_service' is 12.

SQL command for the step:

SELECT * FROM table_sql WHERE num_in_service = 12;
aircraft origin type versions in_service num_in_service
aermacchi sf260 italy trainer t - 260 eu 12 12

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;
aircraft origin type versions in_service num_in_service
aermacchi sf260 italy trainer t - 260 eu 12 12

Verification:

The statement is TRUE