Professional Documents
Culture Documents
Starter Assignment
Starter Assignment
ER
ASSIG
NMENT
Submitted By:
Animesh Nepal
1
Entity Relationship Model
The ER Diagram of the given data and tables with normalization up to 3 rd normal
form is below.
2
Normalization of given data
Table 1 (Session and Fees)
The given table is in 2nd normalized form already. Here, the price is dependent upon
the floor and the floor is dependent upon the session type. So, to change that into transitive
dependency the table is split up into two tables as shown above.
To make the table normalized, new column Staff Id and Role Id was inserted
and the table was split into two with Role Id as a foreign key in ‘Staff Info’ table as
shown above.
For this table, two new columns were added, Booking Id and Customer Id
respectively to break down the table to 2NF form. Then the table is separated into two, one
with booking details and another linked to the customer information.
3
Table 4 (Arcade Machine Information)
The given table has all of its columns dependent on the primary key i.e. Machine
Number and is already in 3rd Normal Form.
For this table, I’ve added two new columns Game Id and Console Id to identify games
and consoles respectively. And later the tables are separated into consoles and games to
remove partial dependency
With the given table in 1NF, the partial dependency between console quantity and session
have been removed by introducing a new columns i.e. Console Id and the table is
separated into two, one with session information and other one with console information.
4
Table 7 (Customers)
A new column, Customer Id is introduced in the table to get it to 1NF. And since, fees
depends upon the member type, new column Member ID is added and the table is split up
into two as shown above. Also, the address column of the customers is split into two
columns Street name and City to reduce data redundancy.
5
Data Dictionary
Table: arcade_machine
Columns
Unique keys
Columns Name / Description
Machine Number PRIMARY
Table: bookings
Columns
6
Links to
Unique keys
Columns Name / Description
Booking id PRIMARY
Table: console
Columns
Table: consoles
Columns
7
Linked from
Console Id PRIMARY
Table: customer_info
Columns
8
Table: customers
Columns
Unique keys
Columns Name / Description
Person Id PRIMARY
Table: floor_price
Columns
9
Table: games
Columns
Table: members_info
Columns
10
Linked from
Unique keys
Columns Name / Description
Member PRIMARY
Id
Table: sessions
Columns
Unique keys
Columns Name / Description
Session Number PRIMARY
11
Table: sessions_info
Columns
Unique keys
Columns Name / Description
Session Number PRIMARY
Table: staff_info
Columns
Links to
12
staff_role.Role Id
Unique keys
Columns Name / Description
Staff Id PRIMARY
Table: staff_role
Columns
Unique keys
Columns Name / Description
Role Id PRIMARY
13
Finished tables and SQL Script
Floor and Price Table
14
Staff Role Table
15
Customer Information Table
Bookings Table
16
Arcade Machine Information Table
Consoles Table
17
Games Information Table
Sessions Table
18
Members Information Table
Customer Table
19
Tables with data and SQL Scripts
Floor and Price
20
Staff Role Table
21
Customer Information Table
22
Arcade Machine Information Table
23
Games Information Table
24
Sessions Console Table
25
Customers Table
Select all customers booked on session 1 who have not yet paid
26
Count all the console games for the PS2
27
Update the floor for Mario from floor 1 to floor 2
28
Delete the machine Phoenix
29