Question:medium

What will be the output of the query?

SELECT MACHINE_ID, MACHINE_NAME FROM INVENTORY
      WHERE QUANTITY <= 100;

Show Hint

SELECT picks two columns, and the sign <= includes the value 100. Match both facts with the options.
Updated On: Oct 20, 2026
  • All columns of INVENTORY table with quantity greater than 100
  • ID and name of machines with quantity less than 100 from INVENTORY table
  • All columns of INVENTORY table with quantity greater than or equal to 100
  • ID and name of machines with quantity less than or equal to 100 from INVENTORY table.
Show Solution

The Correct Option is D

Solution and Explanation

Step 1: Look at the columns first:
The query asks only for MACHINE_ID and MACHINE_NAME.
So the result has two columns, not all columns.
This removes options (A) and (C), which both say 'all columns'.

Step 2: Look at the condition next:
Two options are left, (B) and (D). They differ only in the quantity rule.
The query uses <=, which means 'less than or equal to'.
Take a machine with QUANTITY = 100. Check: 100 <= 100 is true, so this row is shown.
Option (B) says 'less than 100', which would hide this row. So (B) does not match.

Step 3: Confirm with a mini table:
Suppose INVENTORY has quantities 50, 100 and 150.
The rows with 50 and 100 pass the test. The row with 150 does not.
The output has the ID and name of the first two machines only.

Final Answer:
Option (D) is correct: ID and name of machines with quantity less than or equal to 100.
Was this answer helpful?
0