Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A % Conditional Formatting Format as Tablo v Paste Font Alignment Number Cells Cell Styles Editing ES x vfx 56000 C D E F G

image text in transcribed
image text in transcribed
image text in transcribed
A % Conditional Formatting Format as Tablo v Paste Font Alignment Number Cells Cell Styles Editing ES x vfx 56000 C D E F G . 1 OWN Salesid SFirstName SlastName SHireDate Salary 1 Harry Potter 2/13/89 $140,000.00 2 Hermione Granger 5/2/89 $82,000.00 3 Ron Weasley 5/2/89 $93,000.00 4 Dudley Dursley 4/27/96 $56,000.00 5 Katie Bell 5/15/96 $67,000.00 6 Ginny Weasley 6/1/01 $75,000.00 7 Neville Longbottoi 11/9/04 $71,000.00 8 Colin Creevey 4/26/06 562,000.00 8 9 10 12 Your job is to create the 10 queries listed below and answer questions about each query to verify whether you created it correctly. Notice that each quix question (found after the entire list of queries) refers to a specific query from the list. Be sure to refer to the appropriate query when answering each quix question. Although your grade comes from answering the quiz questions correctly, you must also submit the SQL you created to answer each question within the quiz questions below. 1. Generate a list of salespeople and sort it in descending order by hire date Show the first name, last name, hire date, and salary for each salesperson 2.Generate a list of customers whose last name begins with the letter "M" Show the first and last names of these customers. Sort the list of customers in descending order by last name. 3. Generate a list of customers with annual incomes greater than $80,000 who purchased cars from salesperson "Katie." Show the first name, last name, and annual income of each of these customers 4. Which customers purchased vehicles from salesperson "Dudley" despite having a "Poor, **Very Poor " or "Extremely Poor credit rating? Show the first name, last name, and credit description for these customers. 5. Salesperson Colin recently had an encounter with a customer who he would like to contact again. Unfortunately, Colin can't remember if the customer's last name was "Hansenor "Hanson. Construct a query to help Colin find the correct customer to follow up with show the customer's first name, last name, and phone number 6. Construct a query to count how many encounters resulted in the customer declining to make a purchase. Use the COUNT function. (Hints a customer can have many encounters) 7. Customers with low annual income or poor credit ratings often have trouble qualifying for credit. A new, local credit agency may be better able to serve this market segment than the current options can. The manager would like to talk to a few salespeople who have had the most encounters with these customers. Create a list that shows each salesperson (first and last name) and the number of encounters each has had with customers that have an annual income of $25,000 or less or have a credit description that is "Very Poor" or "Extremely Poor." Order the results alphabetically by the salesperson's last name. Your query should have three columns FirstName, LastName, encounter count. 8. Generate a query to find the average income of customers who purchased a car on their interaction 9. Construct a query to show customers with an annual income greater than $100,000 who have a credit rating of "Falc. "Poor, "Very Poot." or "Extremely Poor Show each customer's first name, last name, credit description, and annual income. 10. Management is considering closing on Sundays and would like to have a feeling for the kinds of customers that come to the dealership on Sunday. Create a total query that shows the count of encounters on the Sundays of July 2015-grouped by the credit description held by the customer of the encounter, The Sundays in July of 2015 are the Sth, 12th, 19th, and 26th. Your answer should have two columns (Credit Description and encounter count) and should be sorted alphabetically by credit description (Query 2) How many records are in the result? (Answer should be inputted to the nearest whole number-O decimal places.) (Query 2) True or fulse: Richard Martin is one of the customers in the results. True False (Query 2) True or false: Leticia McCloud is one of the customers in the results. True False Enter the SQL code that you wrote to answer Query 3. Format Font SI A. AQ BI U 5 x x TE - 99

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Question What is a Roth 401(k) feature?

Answered: 1 week ago

Question

Question Can employees make contributions to a profit sharing plan?

Answered: 1 week ago