A "solid" query follows a logical sequence. Expert reviewers from I Programmer suggest a step-by-step translation process: SQL Clause Human Translation What do you want to see? "Give me the names and prices..." FROM Where is it stored? "...from the Products table." WHERE How do you filter it? "...but only those that cost more than $50." ORDER BY How should it be sorted? "...and show the most expensive ones first." 3. Handling Relationships (JOINs)
Use these to total up sales or count your users. SQL Queries for Mere Mortals
Combining two groups together (e.g., a list of all customers and all vendors). A "solid" query follows a logical sequence
Finding what is in one group but not the other (e.g., customers who have never placed an order). 2. Drafting the Statement Handling Relationships (JOINs) Use these to total up
SQL Queries for Mere Mortals: A Hands-On Guide to Data ... - InformIT