Question:

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
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Step 1: Read the query in parts:
SELECT MACHINE_ID, MACHINE_NAME FROM INVENTORY
WHERE QUANTITY <= 100;

SELECT lists the columns to show. Here only MACHINE_ID and MACHINE_NAME are listed.
FROM says which table to read. It is INVENTORY.
WHERE keeps only those rows that pass the condition.

Step 2: Decode the condition:
The sign <= means 'less than or equal to'.
So QUANTITY <= 100 keeps rows where quantity is 100 or fewer.
A row with quantity exactly 100 is included.

Step 3: Join the parts:
The output has two columns, the ID and the name of machines.
Only machines with quantity less than or equal to 100 appear.

Step 4: Check each option:
Option (A) says all columns and quantity greater than 100. Both parts are wrong.
Option (B) says less than 100. That leaves out quantity 100, so it is wrong.
Option (C) says all columns and greater than or equal to 100. Both parts are wrong.
Option (D) says ID and name with quantity less than or equal to 100. This matches.

Final Answer:
The query shows the ID and name of machines with quantity less than or equal to 100. This is option (D).
Was this answer helpful?
0
0