Tutorial 3
Tutorial 3
Readings:
4. Related topics on w3schools, such as literals, select, insert, delete and update
table.
Resources:
1. Wikipedia http://www.wikipedia.org/
Page 1
Part A – SAD Questions (1 mark):
2. List at least 4 techniques for eliciting business requirements and give examples
of each.
3. What are candidate key and primary key? Give an example to illustrate the
differences between them.
4. Compare the entity relationship model and relational data model in detail.
II. Interview (with your group partner) for finding more business rules
and business requirements for the final project.
III. Organise a JAD session for finding more business rules and
business requirements for the final project.
IV. Design a questionnaire list for finding more business rules and
business requirements for the final project? Answer them by
yourself.
V. Observe more business rules and business requirements for the final
project.
You should type your answers to the above questions. Also, you need to keep the
records as these will be included in the system proposal.
Page 2
Part C – SQL Questions (1 mark):
a. Create a room table with the attributes (roomNo, hotelNo, type, price,
guestNo), where roomNo and hotelNo together form the primary key.
b. Insert some values into the room table so that the table record is as follows:
c. Try to insert the following record into the room table. What will happen?
Why?
d. Try to insert the following record into the room table. What will happen?
Why?
e. Insert the following record into the room table. See what will happen.
f. Delete the records of rooms with the number 303. See what will happen.
g. Delete the records of rooms whose roomNo is 333 and whose hotelNo is
321. See what happens. Re-insert the records deleted.
i. Change the price of the room 333 with hotelNo 345 to $5500.
j. Increase the price of all rooms by 15%. See what happens. Why?
Page 3
k. Select all rooms in the roomNo 101.
l. Select only the roomNo and the price of all rooms booked by guestNo 12345.
n. Write an SQL statement to decrease the price of all rooms with roomNo 333
by 20%.
o. Write an SQL statement to select all rooms with the price greater than $500.
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 4