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.
What happens when multiple logical operators (AND and OR) are used in the same query without parentheses?
2.
Which SQL query retrieves products whose names are in another table's result set?
3.
Which SQL query retrieves products with prices \$799.99, \$999.99, or \$1999.99?
4.
Which query retrieves all products that are not priced at \$799.99, \$999.99, or \$1999.99?
5.
Which operator reverses a condition in MySQL?
6.
Which SQL statement retrieves all products that are either Apple desktops OR iPhones priced at $999.99?
7.
Which SQL statement deletes all discontinued products from the product table?
8.
What is the purpose of the OR operator in a MySQL WHERE clause?
9.
Which logical operator is used to filter results based on multiple predefined values?
10.
Which logical operator ensures that all conditions in a WHERE clause must be true?
11.
Which SQL statement retrieves products that cost less than \$1000 or more than \$2000?