Professional Documents
Culture Documents
3. For all orders placed on August 9, 2019 and valued at $1,125 or less, show the customer’s name
(first and last), the order number, and the order total. Results should be put in order from the largest
value to the smallest. (Remember: only copy the top 10 rows – do not worry about the Headers or
Copy with Headers).
4. For each state, what percentage of the state’s population purchased a DustBunny vacuum
(assume everyone in the customer table has purchased a DustBunny vacuum)? Your output should
include the state name, population, number of purchasers from that state, and the percentage
(show as a decimal). Order the output from the highest percentage to the lowest and make sure
each column has a usefully descriptive name. (Remember: only copy the top 10 rows – do not
worry about the Headers or Copy with Headers).
6. Which states’ customers have an average household income over $120,000? Output the name
of each state that meets this requirement, the name of the region where the state is located, and
the states’ customers’ average household income (HHI); order the output in descending order from
highest HHI to lowest and be sure each column has a meaningful name.
7. How many units of each vacuum model were sold during the period from August 11-20, 2019,
and what was the total revenue generated by those sales? Order results from the product with the
highest revenue to the lowest, include the ModelName in your output, and be sure that all columns
have meaningful names. Your output should only include vacuum models (not warranties).
*If the query returns more than 10 lines, include only the first 10 lines of output.
1. Assume you wanted to add another state to the database, the state of Nevernia. Nevernia has a
state code of NA, is in region 2, and has a population of 40,000. Nevernia is a small state. Include
in your submission (1) the query that you would use to add this additional record to the database
and (2) the output of a query that shows the StateIDS, RegionID, Population, and StateName of all
states with a population under 1,000,000 AS WELL AS the query you used to generate this output.
SELECT *
FROM Customer
WHERE Lname = 'Dunn' OR Lname = 'Bryant';
Include in your submission (1) the query that you would use to change (update) Vivian’s record in
the database and (2) the output of a query that shows Vivian’s updated record AS WELL AS the
query you used to generate this output.
Design an original query you think could help lead to important insight for the company.
The query should not be something “obvious” (e.g., do not count the number of products the
company sells), should include more than one table, and should be ordered meaningfully.
Describe what the query will output (i.e., what are you trying to show with the query?).
Describe how DustBunny might use this query to gain insight into their business.
*If the query returns more than 10 lines, include only the first 10 lines of output. Do not about
copying the Column Headers.
1. For each order placed on August 18th, 2019, how many unit items (a unit item is 1 vacuum
cleaner; two of the same model would be 2 unit items; one of one model and one of another would
also be 2 unit items) were purchased? Output only those orders that included two or more unit
items, include in your output the order number and the number of unit items, and order your output
by order number (lowest to highest). (Hint: you will need two tables, SalesOrder and OrderLine.)
(Remember: only copy the top 10 rows – do not worry about the Headers or Copy with Headers).
2. What is the total value of all orders placed for each region? The output should include the name
of the region as well as the total value of all orders placed there. Order results alphabetically by
region. (Hint: the USState table and the Customer table will need to be part of your query.) Based
on these results, to which region do you think the company marketed most heavily during the early
part of August 2019?
3. Which three customers bought the highest number of MadHare units during the period covered
by the database? Your output should include first name, last name, and the number of units
purchased and should include information only about the three customers with the highest number
of MadHare units. Be sure your query references the Model table (i.e., do not look up the model
number for MadHare, instead include in your query content that figures out which records refer to
‘MadHare’).