Sie sind auf Seite 1von 2

IN1010 CLASS TEST 2 - SQL

GENERAL INFO:
• The test will start at 9.30am
• The test will be one hour long
• YOU WILL NOT BE ADMITTED TO THE GREAT HALL AFTER 9.20am
• The test is open book. You may bring whatever materials you want.
• This is an individual test. Sharing of answers will result in both parties
answering to a university academic misconduct panel.

BEFORE THE TEST MAKE SURE:


- You have installed a good text editor - Brackets is recommended
(http://brackets.io/)
- MySQL server and MySQL Workbench are installed and working properly on your
laptop
- You download 'restaurant database setup.sql' from moodle. This contains SQL code
to create the database schema you will use in the test, and inserts sample data.
- Create the test database schema and insert the sample data by running the SQL
code.
- Check your test database is working correctly
- You take time to explore the test database schema and practise running queries on
the database.
- Read these instructions carefully

ON THE DAY OF THE TEST MAKE SURE:


- Your laptop battery is fully charged
- You download the answer sheet 'class-test-SQL-answers.sql' from moodle, available
from 8.30am on the morning of the test.
- You download 'more restaurant data.sql' from moodle, available from 8.30am on the
morning of the test. This contains SQL code to add more data rows to the tables. It
will not not change the restaurant database schema in any way. Insert the data by
running the code.

DATABASE SCENARIO

A restaurant has several rooms, each managed by a Headwaiter. Waiters work in


teams, always under the same Headwaiter. Headwaiters do not serve at tables.
Headwaiters manage different rooms on different days.

The attribute 'Headwaiter’ is the Staff_No of a Headwaiter.


Headwaiters have null values for the attribute ‘Headwaiter’ in the Staff table.
The attribute 'Waiter_No’ is the Staff_No of the waiter who serves the customer.
Dates are stored as numbers which correspond to YYMMDD, eg 12th March 2016 is
stored as 160312.
The attribute 'Covers' is the number of people served at the table.

Interpreting the database schema correctly is part of the test so do not make any
assumptions that are not supported by the schema.

The test questions will ask you to write SQL code to query the restaurant database.
You will be asked to submit the SQL code as answers, NOT the query output.

SUBMISSION

Your SQL answers must be submitted using the SQL answer template 'class-test-SQL-
answers.sql)'.
You must use a text editor such as brackets edit the file.
You must insert your name and city email address where indicated at the start of
the file.
Your SQL code should be entered below the appropriate comment line, e.g.

/* Question 1) SQL code */

Select blah di blah


from doo dah
where etc;

/* Question 2) SQL code */

DO NOT include any output data with your SQL code.


The file MUST be saved as a plain text file.
Upload your answer file to the SQL Class Test submission area on moodle.

Das könnte Ihnen auch gefallen