33. SELECT with Where Clause Bookstore SQL212 Module 1 Example ( Restriction plus Projection ): Select <column-list> From <table-list> Where <selection-criteria>;
34. SELECT with Where Bookstore SQL212 Module 1 Basic Example ( Restriction plus Projection ): select customer_last_name, customer_street from customers where customer_last_name = ‘Jones’
42. IN Bookstore SQL212 Module 1 Select * From customers Where customer_last_name in (‘Rizzo’, ‘Jones’, ‘Garcia’) The list in parentheses can be replaced by a subquery. We will study this later.
44. IS NULL Bookstore SQL212 Module 1 Select * From customers Where customer_street IS NULL SQL uses three valued logic. Must use IS NULL to test for unknowns. A null is NOT the same as blank or empty.
45.
46. BETWEEN Bookstore SQL212 Module 1 Select * From orders Where order_date BETWEEN ‘ 1-jan-99’ and ‘31-dec-99’ Note: date formats vary from product to product.
48. Removing Duplicates Bookstore SQL212 Module 1 Select DISTINCT customer_city From customers List once each city in which there are customers Removes duplicate rows from result set
50. Sorting – ORDER BY Bookstore SQL212 Module 1 DESC will sort in descending order Basic syntax : Select <column list> From <table list> Where <selection criteria> Order by <column list> [DESC]
51. Sorting – ORDER BY Bookstore SQL212 Module 1 Select * From customers Order by customer_state, customer_city Example: List all records sorted by state, city