The questions is to query all the attributes in city table so i us
[SELECT * from city]
*->denotes all the attribute(columns) for every row
from->from the table city.
The question is the query only the names of japanese city from the city by using the countrycode JPN.
[select name from city where countrycode = 'JPN';]
name->they only names of japanese city from city table
where->show the condition where the query to fetch the name(only japanese so they gave countrycode in the question) by using the country code we can take japanese name
This question is same as the previous one, here they ask american cities by using countrycode = 'USA' and also with the population > 100000
[select * from city where population>100000 and countrycode='USA';]
In this question they ask all city names from the table station but the condition is do not start with vowels and not to repeat duplicates.
for not repeat duplicate we use distinct and not include the words starting with vowels so we use NOT LIKE
It is same as 3rd problem in the blog.Here, the difference is population > 120000 and all other query are same.
This is same as the 2nd question in the blog there is no difference between these two questions.
In this question they ask the query all the city with ID=1661 from the CITY table.
[select * from city where ID=1661;]
Here, they ask to query the list of CITY and STATE from the table STATION.so the query is
[Select city,state from station;]








Top comments (0)