Skip to content
Worked Examples · Example 11

Q.Write an SQL query to display the OrderNo and Amount of all orders above 5000 that belong to the customer whose CustID is 3, from the Orders table.

Maharashtra MsbshseTextbookSubjectiveImportance★★★★★est
100% · 14/14 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

This query needs two conditions at once, so we combine them in the WHERE clause with the AND operator (both conditions must be true for a row to be kept):

  1. Amount above 5000: Amount > 5000 — the > operator means 'greater than', and the number is written without quotes.
  2. Belongs to customer 3: CustID = 3 — again a number, written plainly.

We select only the OrderNo and Amount columns. The complete query is:

SELECT OrderNo, Amount FROM Orders
WHERE Amount > 5000 AND CustID = 3;
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.