Database
Database
DBIT
GROUP ASSIGNMENT
DATABASE SYSTEMS
Instructions
1. Ensure should be done in groups as discussed in class of maximum 5 per group.
2. The assignment should be HANDWRITTEN
3. Ensure to indicate the admission numbers of the group members as well as the group
PART A:
Using the tables above, write SQL scripts to achieve the following:
a) List the names and addresses of all guests in London, alphabetically ordered by name.
(2 Marks)
b) List the price and type of all rooms at the Grosvenor Hotel. (3 Marks)
Page 1 of 5
PART B:
Describe the relations that would be produced by the following relational algebra operations:
a) hotelNo ( price > 50 (Room) ) (2 Marks)
Page 2 of 5
Question TWO (15 Marks)
Read the following case study, which describes the data requirements for a video rental
company. The video rental company has several branches throughout the USA. The data held
on each branch is the branch address made up of street, city, state, and zip code, and the
telephone number. Each branch is given a branch number, which is unique throughout the
company. Each branch is allocated staff, which includes a Manager. The Manager is
responsible for the day-to-day running of a given branch. The data held on a member of staff is
his or her name, position, and salary. Each member of staff is given a staff number, which is
unique through out the company. Each branch has a stock of videos. The data held on a video is
the catalog number, video number, title, category, daily rental, cost, status, and the names of the
main actors and the director. The catalog number uniquely identifies each video. However, in
most cases, there are several copies of each video at a branch, and the individual copies are
identified using the video number. A video is given a category such as Action, Adult, Children,
Drama, Horror, or Sci-Fi. The status indicates whether a specific copy of a video is available
for rent. Before hiring a video from the company, a customer must first register as a member of
a local branch. The data held on a member is the first and last name, address, and the date that
the member registered at a branch. Each member is given a member number, which is unique
throughout all branches of the company. Once registered, a member is free to rent videos, up to
a maximum of ten at any one time. The data held on each video rented is the rental number, the
full name and number of the member, the video number, title, and daily rental, and the dates the
video is rented out and returned. The rental number is unique throughout the company.
Required:
i) From the requirements narrative above, identify ALL the entities as well as attributes for
each of the entities (5 Marks)
iv) Using the entities and attributes identified in (i) above, draw a ER- Diagram to clearly
capture the requirements in the narrative above. Write down your assumptions and indicate all
entity relationship cardinality. (Use Crow’s foot notation). (10 Marks)
Page 3 of 5
Question THREE (15 Marks)
a) There are three transaction anomalies, namely the lost update problem, the dirty read/ reading
uncommitted data problem and the inconsistent analysis problem. With relevant examples,
describe each of these. (6 Marks)
b) Consider the following case and use it to answer the questions that follow:
Mwambao, a client of Bank Account no. 200816 in Utamaduni Bank PLC is transferring Ksh.
12,500 from his account to Account no. 201384 run by one of his business associates. The
business associate (owner of account 201384) is also trying to settle a debt of goods supplied by
one of his suppliers and has thus issued an electronic transfer request for Ksh. 28,000 in favour
of his supplier. This e-transfer is to be effected immediately as there are anticipated funds that
should reach the account as soon.
Consider the following transaction schedule, assuming the bank has a rule that minimum
balances cannot go below zero.
Page 4 of 5
Question FOUR (15 Marks)
An agency called Gumbaru Agency supplies part-time/temporary staff to hotels within Kenya.
The table shown below displays sample data, which lists the time spent by agency staff working
at various hotels. The National Insurance Number (NHIF_NO) is unique for every member of
staff.
b) Normalize the relation (Figure 1) above, showing how you progress from 1NF through 2NF
to a set of 3NF named relations. At each stage show the primary key and any foreign keys of
each relation and state assumptions that you make about any of the relationships between the
columns of data. Give your relations meaningful names. (9 Marks)
Page 5 of 5