Filtering data is a fundamental part of working with databases, and MySQL provides powerful logical operators to refine query results. This quiz will test your understanding of how to use AND, OR, IN, NOT, and subqueries within the WHERE clause to create precise and efficient queries.
1.
Which SQL statement retrieves products that cost less than \$1000 or more than \$2000?
2.
Which SQL statement retrieves all products that are either Apple desktops OR iPhones priced at $999.99?
3.
What happens when multiple logical operators (AND and OR) are used in the same query without parentheses?
4.
Which logical operator ensures that all conditions in a WHERE clause must be true?
5.
Which SQL query retrieves products with prices \$799.99, \$999.99, or \$1999.99?
6.
Which SQL query retrieves products whose names are in another table's result set?
7.
What is the purpose of the OR operator in a MySQL WHERE clause?
8.
Which SQL statement deletes all discontinued products from the product table?
9.
Which operator reverses a condition in MySQL?
10.
Which query retrieves all products that are not priced at \$799.99, \$999.99, or \$1999.99?
11.
Which logical operator is used to filter results based on multiple predefined values?