Question:

Which Sql Statements correctly retrieves records from a 'Commodity' table where the Price is either above 1000 or the product Category is 'Sales'?

Show Hint

Use OR when satisfaction of any single condition is acceptable.
Use AND when all listed conditions must be met simultaneously.
SQL uses the English word OR, unlike programming languages that use ||.
Updated On: Sep 7, 2026
  • SELECT * FROM Commodity WHERE Price$>$1000 OR Category ='Sales';
  • SELECT * FROM Commodity WHERE Price$>$1000 AND Category ='Sales';
  • SELECT * FROM Commodity IF Price$>$1000 OR Category ='Sales';
  • SELECT * FROM Commodity WHERE Price$>$1000 || Category =Sales;
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept:
Filtering queries in SQL often require combining multiple criteria using logical operators.
The primary logical operators in standard SQL are AND, OR, and NOT.

Step 1: Translating the Logical Condition:

The question requires records where:
1. The Price is greater than 1000: expressed as Price > 1000.
2. OR the product Category equals 'Sales': expressed as Category = 'Sales'.
When either condition being true is sufficient to select the row, the logical connective OR must be used.
The complete valid SQL statement is:
SELECT * FROM Commodity WHERE Price > 1000 OR Category = 'Sales';

Step 2: Checking Flaws in the Distractors:

Option (B) uses the logical operator AND, which would restrict the output strictly to rows where both conditions are simultaneously satisfied.
Option (C) replaces the mandatory WHERE keyword with IF, which violates SQL syntax.
Option (D) uses || (which represents string concatenation in standard ANSI SQL) and omits quotation marks around the string literal Sales.
Final Answer:
Option (A) is the grammatically and logically correct SQL statement.
Was this answer helpful?
0
0