Tutorial 4
Tutorial 4
Readings:
3. Related items on Wikipedia, such as use case analysis, relational algebra, join,
and so on.
Resources:
1. Wikipedia http://www.wikipedia.org/
Page 1
Part A – SAD Questions (1 mark):
1. What are the relationships and differences between events and use cases?
3. Write a statement in relational algebra to select the type of all rooms in hotelNo
321 with the price less than $150
SAD – use case analysis. Conduct use case analysis for the final project.
Consider the following 3 different categories.
a) Staff
b) Customer
c) Timetable
You need to analyse at least one use case for each category listed above. You
should type your answers to the above questions.
Page 2
Part C – SQL Questions (1 mark):
a) Write an SQL statement to select all rooms in the hotelNo 345 with the price
less than $150, and order the results first by roomNo and second by types.
b) Write an SQL statement to add columns view and floor to the Room table.
d) Select the rooms not in hotelNo 300 and whose roomNo is not 101.
e) Select the rooms not in hotelNo 445 or whose roomNo is not 101.
f) Select the rooms in hotelNo 362 and order the results in a descendent order.
g) Select the rooms with a price greater than $110, and order the results firstly by
price in an ascendant order, and secondly by type in a descendent order.
k) Drop the column hotelNo in the room table. What happened? Why?
l) Change the data type of the column price into some numerical data type with
decimals.
Note: for comparison purposes, you’d better keep all records of your SQL statements
(simply save them in a separate .txt file). You must take screenshots of your
queries and the results too.
Page 3