Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: in the unwto region of asia , 57.7 million international tourist arrivals (2012) which was less than in 2011

Table: tourism

rank country unwto_region international_tourist_arrivals__2012_ international_tourist_arrivals__2011_ change__2011_to_2012_ change__2010_to_2011_
1 france europe 83.0 million 81.6 million + 1.8% + 5.0%
2 united states north america 67.0 million 62.7 million + 6.8% + 4.9%
3 china asia 57.7 million 57.6 million + 0.3% + 3.4%
4 spain europe 57.7 million 56.2 million + 2.7% + 6.6%
5 italy europe 46.4 million 46.1 million + 0.5% + 5.7%
6 turkey europe 35.7 million 34.7 million + 3.0% + 10.5%
7 germany europe 30.4 million 28.4 million + 7.3% + 5.5%
8 united kingdom europe 29.3 million 29.3 million - 0.1% + 3.6%
9 russia europe 25.7 million 22.7 million + 13.4% + 11.9%
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'unwto_region' is 'asia'.

Step 2: Select rows where 'international_tourist_arrivals__2012_' is less than 'international_tourist_arrivals__2011_'.

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

Step 1: Select rows where 'unwto_region' is 'asia'.

SQL command for the step:

SELECT * FROM table_sql WHERE unwto_region = 'asia';
rank country unwto_region international_tourist_arrivals__2012_ international_tourist_arrivals__2011_ change__2011_to_2012_ change__2010_to_2011_
1 france europe 83.0 million 81.6 million + 1.8% + 5.0%
2 united states north america 67.0 million 62.7 million + 6.8% + 4.9%
3 china asia 57.7 million 57.6 million + 0.3% + 3.4%
4 spain europe 57.7 million 56.2 million + 2.7% + 6.6%
5 italy europe 46.4 million 46.1 million + 0.5% + 5.7%
6 turkey europe 35.7 million 34.7 million + 3.0% + 10.5%
7 germany europe 30.4 million 28.4 million + 7.3% + 5.5%
8 united kingdom europe 29.3 million 29.3 million - 0.1% + 3.6%
9 russia europe 25.7 million 22.7 million + 13.4% + 11.9%

Step 2: Select rows where 'international_tourist_arrivals__2012_' is less than 'international_tourist_arrivals__2011_'.

SQL command for the step:

SELECT * FROM table_sql WHERE international_tourist_arrivals__2012_ < international_tourist_arrivals__2011_;
rank country unwto_region international_tourist_arrivals__2012_ international_tourist_arrivals__2011_ change__2011_to_2012_ change__2010_to_2011_
3 china asia 57.7 million 57.6 million + 0.3% + 3.4%

Step 3: 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;
rank country unwto_region international_tourist_arrivals__2012_ international_tourist_arrivals__2011_ change__2011_to_2012_ change__2010_to_2011_

Verification:

The statement is FALSE