jueves, 27 de abril de 2017

Revising the Select Query I

Revising the Select Query 









Query all columns for all American cities in CITY with populations larger than 100000. The CountryCode for America is USA.
Input Format
The CITY table is described as follows:
select * from CITY where CITY.POPULATION >'100000' and COUNTRYCODE='USA';


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

Input Format
The CITY table is described as follows:CITY.jpg
select CITY.NAME from CITY where CITY.POPULATION >'120000' and COUNTRYCODE='USA';


*********************************************
Query all columns (attributes) for every row in the CITY table.

Input Format
The CITY table is described as follows:CITY.jpg

SELECT * FROM CITY

********************************************************
Query all columns for a city in CITY with the ID 1661.

Input Format
The CITY table is described as follows:
SELECT * FROM CITY WHERE CITY.ID = '1661';

************************************************************************************


Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN.

Input Format
The CITY table is described as follows:

SELECT * FROM CITY WHERE CITY.COUNTRYCODE='JPN';

***********************************************************************
Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.
Input Format
The CITY table is described as follows:
SELECT city.name FROM CITY WHERE CITY.COUNTRYCODE='JPN';

************************************************


Query a list of CITY and STATE from the STATION table.

Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.

SOLUTION:

           SELECT CITY,STATE from STATION;


Explanation:

    The question is that we have been asked to write a query that lists the CITY and STATION fields present in the table STATION.

No hay comentarios:

Publicar un comentario

Blogger Widgets