You are on page 1of 2

1) Query the list of CITY names starting with vowels (i.e.

, a, e, i, o, or u) from
STATION.
Your result cannot contain duplicates.
Table: Station

Field | Type

ID NUMBER
CITY VARCHAR2()
STATE VARCHAR2()
LAT_N NUMBER
LONG_W NUMBER

SOLUTION: SELECT distinct city FROM station WHERE city REGEXP '[aeiou]$';

2) Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
Your result cannot contain duplicates.
Table: Station

Field | Type

ID NUMBER
CITY VARCHAR2()
STATE VARCHAR2()
LAT_N NUMBER
LONG_W NUMBER

SOLUTION: SELECT distinct city FROM station WHERE city REGEXP '^[a]|^[e]|^[i]|
^[o]|^[u]';
3) Query all columns for all American cities in CITY with populations larger than
100000.
The CountryCode for America is USA.
Table: City

Field | Type

ID NUMBER
NAME VARCHAR2
COUNTRYCODE VARCHAR2
DISTRICT VARCHAR2
POPULATION NUMBER

SOLUTION: select * from city where population >100000 and countrycode='USA';

4) Query the names of all American cities in CITY with populations larger than
120000.
The CountryCode for America is USA.

Table: City

Field | Type

ID NUMBER
NAME VARCHAR2
COUNTRYCODE VARCHAR2
DISTRICT VARCHAR2
POPULATION NUMBER

SOLUTION: select name from city where population > 120000 and countrycode='USA';
4)

You might also like