Question: Write the SQL statements to satisfy the following queries. 4 Marks per question. --Q1. List the service id and description for the services where unit

Write the SQL statements to satisfy the following queries. 4 Marks per question.

--Q1. List the service id and description for the services where unit price is more than $4

--Q2. List all details for the services that have "Q" type with a unit price under $15

--Q3. List the details for the customers that are of either from Toronto or Oshawa and whose last name is Miller

--Q4. List the details for the services whose type is neither "S" nor "E" (Dont just test for "Q")

--Q5 List the details for all services with a unit price of at least $3.50 but not more than $5.00. Place the output in alphabetical sequence by service description

--Q6. List the details for all customers whose email contains the characters "any"

--Q7. Show the count of the number of customers in Toronto

--Q8. What is the minimum unit price for type "E" services?

--Q9 Show the count of the number of different cities customers are located in

--Q10 List the details for services that have appeared as invoice items. Output in service description sequence. Only show each service once

Write the SQL statements to satisfy the following queries. 4 Marks per question.

--Q1. List the service id and description for the services where unit price is more than $4

--Q2. List all details for the services that have "Q" type with a unit price under $15

--Q3. List the details for the customers that are of either from Toronto or Oshawa and whose last name is Miller

--Q4. List the details for the services whose type is neither "S" nor "E" (Dont just test for "Q")

--Q5 List the details for all services with a unit price of at least $3.50 but not more than $5.00. Place the output in alphabetical sequence by service description

--Q6. List the details for all customers whose email contains the characters "any"

--Q7. Show the count of the number of customers in Toronto

--Q8. What is the minimum unit price for type "E" services?

--Q9 Show the count of the number of different cities customers are located in

--Q10 List the details for services that have appeared as invoice items. Output in service description sequence. Only show each service once

--Q11 List the average unit price for services by type .Sequence by highest count to lowest

--Q12 Show a count of invoices by customer id but only display results with a count of at least 2

--Q13 List the service id for "E" type services that have appeared on more than 1 invoice.

Write the SQL statements to satisfy the following queries. 4 Marks perquestion. --Q1. List the service id and description for the services whereunit price is more than $4 --Q2. List all details for the

INVOICE SERVICE Column Name Condensed Type Nulable 8 InNo Column Name Condensed Type Nulable Servicel No No No No numericiB, 2) No numeric(8. 2) Yes numeric(B, 2) Yes Has been scid EM CUSTOMER Column Name Condenced Type Nulable No Column Name Condensed Tye Nulable 9 CustD No ServicelD No Quantityint nvUnitPrice numeric B, 2 Yes No CustlD EirstName LastName Phone City Toronto Nikki.Kaccaton@anywhere.com Markham Brenda.Catnazaro@somewhere.com Oshawa Bruce LeCat@somewhere.com Oshawa Betsy.Miller@anywhere.com Markham George.Miller@somewhere.com Toronto Kathy.Miller@anywhere.com Toronto Betsy.Miller@elsewhere.conm Barrie John.Brown@nowhere.conm Email 100 Nikki 105 Brenda Catnazaro. 110 Bruce 115 Betsy 120 George 125 Kathy 130 Daisy 135 John LeCat Miller Miller Miller Miller Brown 723-543 1233 723-543- 2344 723-543- 3455 725-654 3211 725-654 4322 723-514 9877 723-514 8766 723-177 8877 Cuetin Dateln Dateut Suhtotal Tav CustID DateQut 2012-10-06 2012-10-06 2012-10-08 2012-10-08 2012-10-11 2012-09-13 2012-09-13 2012-09-14 2012-09-14 Subtotal Tax 2012001 2012002 2012003 2012004 2012005 2012006 2012007 2012008 2012009 100 2012-10-04 105 2012-10-04 100 2012-10-06 115 2012-10-06 125 2012-10-07 110 2012-09-11 110 2012-09-11 130 2012-09-12 120 2012-11-12 158.5 25 49 17.5 12 152.5 12.52 1.98 3.87 1.38 0.95 12.05 0.55 11.1 2.13 9 140.5 27 lnvNoServicelD Quantity InvUnitPrice 2012001 2012001 2012001 2012001 2012001 2012001 2012002 2012003 2012003 2012004 2012005 2012005 2012006 2012006 2012006 2012006 2012007 2.5 3.5 16 20 25 40 50 10 10 10 2.5 10 20 25 2.5 2.5 3.5 2.5 3.5 16 10 16 20 25 16 10 10 3.5 10 Men's Shirt 11 Dress Shirt 15 Women's Shirt 16 Blouse 17 Dress Blouse 20 Slacks-Men's 25 Slacks-Women's 30 Skirt 31 Dress Skirt 40 Suit-Men's 45 Suit-Women's 50 Tuxedo 60 Formal Gown 1.5 S 2.5 S 1.5 E 3.5 S 4.5 E 6 E 5 E 8.5 E 10 Q 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!