Instagram
youtube
Facebook
Twitter

Query all columns

Problem

Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.

The CITY table is described as follows:

 

Solution:

SELECT * FROM CITY

WHERE POPULATION >= 100000 AND COUNTRYCODE ="USA"

Explanation:

  • The SELECT statement is used to query data from a database.
  • The * symbol is a wildcard that tells the database to return all columns from the CITY table.
  • The FROM clause specifies the table from which to retrieve the data.
  • WHERE: The WHERE clause is used to filter records.
  • AND: The AND operator is used to combine multiple conditions.