Filter Products Using WHERE with IN List
📖 Scenario: You are managing a small store's product database. You want to find products that belong to specific categories to prepare a special sale.
🎯 Goal: Build an SQL query that selects products from the products table where the category is one of a given list using the WHERE ... IN clause.
📋 What You'll Learn
Create a
products table with columns id, name, and category.Insert exactly five products with specified categories.
Create a list of categories to filter.
Write a SELECT query using
WHERE category IN (...) to get products in those categories.💡 Why This Matters
🌍 Real World
Filtering products by categories is common in online stores to show customers only relevant items.
💼 Career
Knowing how to use WHERE with IN lists is essential for database querying in roles like data analyst, backend developer, and database administrator.
Progress0 / 4 steps