Non correlated sub queries II


this is the example that was given, SELECT *
FROM flights
WHERE origin in (
FROM airports
WHERE fac_type = 'SEAPLANE_BASE');

and i was given this instruction

Using the same pattern, find flight information about flights where the Federal Aviation Administration region (faa_region) is the Southern region (ASO)..

this was my query

select * from flights where
(select code from airports where faa_region = 'aso');.

the system can't validate the query


We are using SQLite

For an overview of the so-called SCHEMA defintion
select * from sqlite_master;

You have to undestand that
in the flights-Table you have the field origin
in the airports-Table you have the field code

select origin,carrier      /*select fields*/
from flights               /*from the flights-table*/
where  origin in           /*where the VALUE of the origin-field*/
(select code               /*can be found in the =list= of code-VALUES*/
from airports              /*found in the airports-Table*/
where faa_region = "ASO"); /*where the field faa_region */
                           /*has the upperCase-String-Value "ASO" */

To get a better feel


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.