Question: Write the SQL statements to achieve the objectives described below, based on the database provided. 30 marks total for this question. All SQL must be

Write the SQL statements to achieve the objectives described below, based on the database provided. 30 marks total for this question. All SQL must be compatible with Microsoft T-SQL. (A) Write appropriate queries which will insert a new caf into the database with a valid address somewhere in Australia. The caf should have three tables for customers to sit at (two inside and one outside). (10 marks) (B) Create a view that shows the waiterID, Full name and total amount of sales money made by each waiter. Sales should be calculated from the quantity of coffees sold plus tips. If a waiter has made no sales, display O instead. weiterld Waiter Sales 1 Boris Andresson $6.50 2 2 Snarfle Devitt $12.00 3 Catholomew Deniti $17.00 Alice Andresson $18.50 Dangus Smalsbury $3.50 1 3 4 5 4 5 6 6 Lana Lim 0 (10 marks) (C) Write a query to select the surname and supervisor's surname of all staff who make less sales than "Cartholomew Dewitt". Use the view from part B in your answer. Supervisor 1 2 3 4 Water Andresson Dewit Smalobury Lim NULL Andresson Andreason Andresson (10 marks) Write the SQL statements to achieve the objectives described below, based on the database provided. 30 marks total for this question. All SQL must be compatible with Microsoft T-SQL. (A) Write appropriate queries which will insert a new caf into the database with a valid address somewhere in Australia. The caf should have three tables for customers to sit at (two inside and one outside). (10 marks) (B) Create a view that shows the waiterID, Full name and total amount of sales money made by each waiter. Sales should be calculated from the quantity of coffees sold plus tips. If a waiter has made no sales, display O instead. weiterld Waiter Sales 1 Boris Andresson $6.50 2 2 Snarfle Devitt $12.00 3 Catholomew Deniti $17.00 Alice Andresson $18.50 Dangus Smalsbury $3.50 1 3 4 5 4 5 6 6 Lana Lim 0 (10 marks) (C) Write a query to select the surname and supervisor's surname of all staff who make less sales than "Cartholomew Dewitt". Use the view from part B in your answer. Supervisor 1 2 3 4 Water Andresson Dewit Smalobury Lim NULL Andresson Andreason Andresson (10 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
