Filtering Data Using WHERE with OR Operator
📖 Scenario: You are managing a small bookstore database. You want to find books that are either by a specific author or belong to a certain genre.
🎯 Goal: Build an SQL query that selects books where the author is either 'J.K. Rowling' or the genre is 'Fantasy'.
📋 What You'll Learn
Create a table called
books with columns id, title, author, and genreInsert exactly 5 rows with specified values
Write a SELECT query using
WHERE with OR to filter books by author or genreUse exact column and table names as specified
💡 Why This Matters
🌍 Real World
Filtering data with multiple conditions is common in databases for reports, searches, and data analysis.
💼 Career
Knowing how to use WHERE with OR helps in writing flexible queries for business intelligence, software development, and data management roles.
Progress0 / 4 steps