A WHERE clause filters query results by keeping only rows that satisfy a condition. It works with SELECT and FROM: SELECT chooses columns, FROM chooses the table, and WHERE narrows the rows. section 1.5 section 1.7
Build a filter by following these practical rules:
- Compare numeric values directly, such as price < 30. section 1.7
- Compare text values with an equality sign and single quotes, such as manufacturer = 'Mad Inventors Inc.'. section 1.7
- Join conditions with AND when every condition must match, or OR when either condition can match. section 1.7
- Finish the query with a semicolon. section 1.5
Filter the product table
To retrieve product names and descriptions for products costing less than 30, write: SELECT name, description FROM product WHERE price < 30; To require both a price and manufacturer match, select every column and combine the conditions: SELECT * FROM product WHERE price < 30 AND manufacturer = 'Mad Inventors Inc.'; section 1.7
SELECT * FROM product WHERE price < 30 AND manufacturer = 'Mad Inventors Inc.';
Inspect a complete WHERE clause that combines a numeric price condition with a manufacturer condition. section 1.7






