To find a manufacturer's name and city, query this table.
What is Manufacturer?
(Now write the query for Q1!)
These tables are needed to find customers who have purchased something in a particular month and year.
What are Customer and Sale?
(Now write the query for Q5!)
When selecting products that have been sold in a given month, it's a good idea to use this keyword so that you don't get duplicate results.
What is DISTINCT?
(Now write the query for Q9!)
Any column included in a query using an aggregation function that is not aggregated must appear in this clause.
What is GROUP BY?
When looking for a string that is similar to a given value, use this keyword and this wildcard.
What are LIKE and %?
(Now write the query for Q1!)
The date of the sale and the shipping appear in this table.
What is Sale?
It's a good idea to use this when joining two or more tables together.
What is an alias?
(Now write the query for Q6!)
When giving a table or field an alias, put the alias after a space or use this keyword.
What is AS?
To find the maximum cost of any sale item sold to a given customer, use these tables.
What are SaleItem, Sale and Customer?
(Now write the query for Q10!)
To find records where tax was charged, use > or this boolean keyword.
What is NOT?
(Now write the query for Q4!)
Quantity and sale price can be found in this table.
What is SaleItem?
You need to join this many tables together to find manufacturer names that have had products purchased in a given month.
What is four?
(Now write the query for Q9!)
This keyword is used to find records with values inside a range.
What is BETWEEN?
(Now write the query for Q7!)
To find the highest and lowest values in a field, use these SQL built-in functions.
What are MIN and MAX?
(Now write the query for Q11!)
To find the minimum and maximum total price of items sold in a given month where maximum> minimum, use this clause (state the whole clause).
What is HAVING MAX(Quantity*SalePrice) > MIN(Quantity*SalePrice)?
(Now write the query for Q13!)
City, state and postal code appear in these three tables.
What are Customer, Manufacturer and Employee?
A query to find the maximum amount spent on a product by a given customer in a given month requires joining these tables.
What are Customer, Sale and SaleItem?
(Now write the query for Q10!)
To find the average of all sales in 2015, use this SQL slang and this technique.
What are AVG() and a subquery in the FROM clause.
(Now write the query for Q16!)
To get the total for each sale on a given day, use this bit of SQL slang and these two columns.
What are SUM(), Quantity and SalePrice?
(Now write the query for Q12!)
To find the average list price for manufacturers that supply at least 10 products, use this clause.
What is HAVING COUNT(ProductID) >= 10?
(Now write the query for Q14!)
This column appears as the primary key in three tables.
What is EmployeeID?
The question in Participation 7 that joins the maximum number of tables is this one.
What is Question 8?
(Now let's write the query!)
Use these three SQL keywords to get the major parts of a date.
What are YEAR(), MONTH() and DAY()?
(Now write the query for Q5!)
To find a list of sneakers whose price is less than the average price for flats, use this technique.
What is a subquery in the WHERE clause?
(Now write the query for Q15!)
To find the minimum list price for each combination of category and color where the maximum list price is 2x the average price for all products, use this technique.
What is a subquery in the HAVING clause?
(Now write the query for Q17!)