You are on page 1of 1

IN1010

- SQL In-class Test



Time – 1hr

Using the restaurant database schema, specify each of the following as SQL queries.

Questions 1 to 4 are worth up to 5 marks.

1) List the dates and bill totals for customer 'David Hookman'.
2) List the names of all customers whose first names begin with 'T'. List each customer only
once.
3) List all the details of bills dated January 2016.
4) How much money has the restaurant taken? Change the name of the output column to
'Income'.

Questions 5 to 12 are worth up to 10 marks

5) On which dates in February 2016 did the Headwaiter 'Alphonso' manage the 'Blue' room?
You may output dates in the format they are stored.
6) List the names of the waiters who serve tables in the same team as the waiter 'Jimmy
Smith'.
7) List the names of customers who spent more than 150.00 on a single bill on occasions
when ‘Alphonso’ was their Headwaiter.
8) A customer called 'Terry Jones' has complained about the behavior of a waiter called
‘Jimmy’ when he dined at the restaurant on the 11th January 2016. What is the name of the
Headwaiter who will have to deal with the matter?
9) What is the name of the waiter who has taken the most money on a single bill? List only
one name in your answer.
10) List the rooms with tables that sit more than 6 people and how many of such tables they
have.
11) List the headwaiter’s name sequence and the total bill amount their waiters have taken.
Order the list by total bill amount.
12) List any customers who have spent, on average, more than £200 each time they have
visited the restaurant.

You might also like