Skip to main contentSkip to solution

What will be the output of the following query?

SELECT COUNT(*) FROM INVENTORY WHERE Model="VXI";

Solution

✅ Correct Option: 2

COUNT(*) counts every row that passes the WHERE filter. Here only rows with Model = "VXI" are kept, so the query returns the number of records in the INVENTORY table whose Model is "VXI".


Option 1: ignores the WHERE condition. The filter is applied before counting.

Options 3 and 4: COUNT(*) counts whole rows, including those with NULLs in other columns. Only COUNT(column) skips NULL values in that column.

Keyboard Shortcuts

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