30 January 2018

Weather Observation Station 4

My solution:
SELECT COUNT(CITY) - COUNT(DISTINCT CITY) 
FROM   STATION; 

Weather Observation Station 3

My solution:
SELECT DISTINCT CITY 
FROM   STATION 
WHERE  ID % 2 = 0; 

Weather Observation Station 1

My solution:
SELECT CITY, 
       STATE 
FROM   STATION; 

Japanese Cities' Names

My solution:
SELECT NAME 
FROM   CITY 
WHERE  COUNTRYCODE = "JPN"; 

Japanese Cities' Attributes

My solution:
SELECT * 
FROM   CITY 
WHERE  COUNTRYCODE = "JPN"; 

Select By ID

My solution:
SELECT * 
FROM   CITY 
WHERE  ID = 1661; 

Select All

My solution:
SELECT * 
FROM   CITY; 

Revising the Select Query II

My solution:
SELECT NAME 
FROM   CITY 
WHERE  POPULATION > 120000 
       AND COUNTRYCODE = "USA"; 

Revising the Select Query I

My solution:
SELECT * 
FROM   CITY 
WHERE  POPULATION > 100000 
       AND COUNTRYCODE = "USA";