


Task 9: Display games aimed at our seasoned players (Tough category).Ĭopy to clipboard select * where J = 'Tough'Įxplanation: Select all columns but only show rows where the data in column J (Complexity) is equal to the text string Tough. So, we select all columns but only show rows where the data in column I (Complexity Level) is less than the numerical value of 4. Task 8: Display games with Complexity Levels less than 4.Įxplanation: Let’s say you only want to create a board games app excluding those with difficult / tough levels. Task 7: Display games with Complexity Levels greater than or equal to 3.Įxplanation: Select all columns but only show rows where the data in column I (Complexity Level) is greater than or equal to the numerical value of 3. Warning Text values (string literals) are enclosed in 'single quotes' or "double quotes" while numbers are not. Task 5: Show only the Top 5 performers (starting with the highest scorer).Ĭopy to clipboard select * order by H desc limit 5 Corporate (Ranking for: Departmental contest, Grants / funding, promotion, etc.Education (Top 10 students, Top 100 applicants, Scholarship recipients, etc.).Task 4: Display everything then sort by Complexity in reverse alphabetical order, then by Complexity Level.Ĭopy to clipboard select * order by J desc, IĮxplanation: Select all columns and sort the rows by the values in column J (Complexity) in descending order (Tough, Intermediate, Easy), then by the values in column I (Complexity Level) in ascending order.ĭisplay only the top-ranked items with applications in: Info To save time, you can omit asc altogether since the Query output is arranged in ascending order by default (low-high or a-z). We are going to use three different Awesome Table apps to explain how Query clauses work. Hands-on examples using the Query expression syntax In the sidebar, open the Advanced parameters section. label C 'Top 10' - fnally, label column C as Top 10ġ.limit 10 - then display only the first 10 items.order by C desc - sort the numeric entries on column C in descending order (highest to lowest).where C >= 90 - only display entries in column C whose value is greater than or equal to 90.select * - use all columns in the data source.If omitted, all rows are returned.Įxample using all five clauses listed above, following the prescribed sequence or order: select * where C >= 90 order by C desc limit 10 label C 'Top 10' Returns only rows that match a condition. If omitted, all of the table's columns are returned, in their default order (from top to bottom). Your new request, for a query to "join the three tables without returning multiple rows with the same value and that are older than 90 days old", needs clarification on what should not be duplicated.Selects which columns to return, and in what order. To include customers without any rows whatever in customer_ads, you need this instead:ĪND ca.start_date >= DATE_SUB(CURDATE(),INTERVAL 90 DAY)ģ. Your original request was for "the records for all clients that have NOT placed an order in the past 90 DAYS." Assuming columns id in and start_date in a table named customer_ads, this is the answer from customer_ads alone-that is, it retrieves only ids which exist in customer_ads and for which there is not a row with start_date more than 90 days ago:ĪND c2.start_date >= DATE_SUB(CURDATE(),INTERVAL 90 DAY)Ģ.
