SQL LESSON 5 OF 32

Filter with WHERE

WHERE keeps rows whose condition is true. Compare with =, !=, <, >, <= or >=. Text literals use single quotes. Unlike Python, SQL equality uses one =.

हिन्दी में समझें

WHERE सही शर्त वाली पंक्तियाँ रखता है। =, !=, <, >, <=, >= से तुलना करें। टेक्स्ट सिंगल कोट में लिखें। SQL में बराबरी के लिए = है।

अभ्यास: 500 से महँगे उत्पादों के name और price दिखाएँ।

Hinglish mein samjhein

WHERE true condition wali rows rakhta hai. Text single quotes mein likho. Python ke unlike SQL equality mein ek = hota hai.

Practice: 500 se mehange products ke name aur price dikhao.

A small SQL example

SELECT name, city FROM customers WHERE city = 'Delhi';

Examples use the fictional shop database bundled with the SQL playground: customers, products, orders, order_items and employees. The engine is SQLite; other SQL dialects may differ.

Try this example in the SQL playground →

Practise this idea

Show name and price of products costing more than 500.

Check answer & explanation
SELECT name, price FROM products WHERE price > 500;

WHERE price > 500 keeps only prices strictly above 500. Selecting name and price returns the requested product details.

Stuck in the course? Choose Check answer for either the challenge or quiz. Read the explanation and continue to the next lesson at your own pace.

Check your understanding

SQL equality uses…

  1. =
  2. ==
  3. =:=
Check the quiz answer

=

WHERE keeps rows whose condition is true. Compare with =, !=, <, >, <= or >=. Text literals use single quotes. Unlike Python, SQL equality uses one =.

References & corrections

Use the official SQLite documentation for full language rules. Read how these lessons are made and checked. Found a mistake? Report it to Excel Keys with this lesson URL and a reproducible example.

FROM LEARNING TO BUSINESS RESULTS

Need a dashboard for your team?

Excel Keys designs custom Excel and HTML dashboards around your own KPIs and Excel files. They run offline in the browser, so your data stays on your computer.