Skip to main contentSkip to solution

Fill the appropriate clause in the below SQL code to retrieve all columns from the 'customers' table where country is equal to 'USA' and city is equal to 'New York'.

SELECT * _____ customers WHERE COUNTRY = 'USA' AND CITY = 'NEW YORK'

Solution

✅ Correct Option: 1

The blank sits between the column list and the table name, so it needs the FROM clause. In SQL, FROM names the table to read data from, giving the structure SELECT columns FROM table WHERE condition.

Here, SELECT * picks all columns, FROM customers picks the table, and WHERE COUNTRY = 'USA' AND CITY = 'NEW YORK' filters the rows.


Option 2: WHERE is already used later in the query to filter rows. It cannot replace FROM, because the table name must be given first.

Option 3: HAVING filters groups after GROUP BY, and it does not specify a table.

Option 4: COUNT is an aggregate function, not a clause.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question