DATABASE DESIGN FOR HOTE DU AUSTRIA: PROBLEM & SOLN. PROBLEM Assume that you are an employee of a consultancy firm. Your firm has been hired to design and implement a database to support operations at the Hote description of the hotel follows: du Austria. A The hotel has three branches with all branches located in the same city. Each branch of the hotel has 100 rooms - (10 suites, 50 single rooms, 40 double rooms). Each branch of the hotel houses and manages a 4-star restaurant named Michelin, an entertainment lounge, a bar, a physical fitness room, a travel agency, a drugstore and a swimming pool for the guests. For branches, the information to be stored is the branch id (bid), branch location (b_locn) and branch manager (b_mgr). The travel agency which is named Travel City provides travel services for making local and international travel arrangements for guests and walk-ins. Customers visiting the travel services go to different branches of the hotel on different days depending on their convenience. Customers are assigned an ID and given a key card. Other customer information such as name address and phone are also stored. The drugstore, Trustworthy is open 24 hours a day, 7 days a week. It provides service to both guests and walkins. Lately, Trustworthy s managers have noticed that many customers go to more than one branch to fill their prescriptions. Since some customers have allergies or relevant medical conditions, it would be best for the managers of different branches to share information on the customer s medical history. Currently, the customers use cash or credit card (CC#) as a payment method, every time they encounter an expense at the hotel. One of the policies of management is to provide fast, convenient and unobtrusive service to customers such that a guest need not carry money to enjoy the hotel s amenities. In order to facilitate this policy, the management desires to include billing of meal, travel, drugstore, and entertainment expenses to the guest s room-bill as and when the expenses are incurred. Guests are shown a form that shows the invoice number (inv#), date (dt) and time (t) of the expense, the items & descriptions (item# & descr.) on the bill and the total amount. The management also desires to support instantaneous querying facility (on-line input with real time processing) of room bill status by management and authorized members of the staff. The new system should include a menu screen that can be used by the hotel receptionists to answer the following queries: 1) expenses by category such as pharmacy, restaurant etc. 2) a listing of current expenses and current total, 3) final bill showing all expenses and a grand total. Required: 1) FD diagram, 2) design 3) an explanation of how design meets requirements. PROBLEM ANALYSIS (ECLASSES ARE OUTLINED) Assume that you are an employee of a consultancy firm. Your firm has been hired to design and implement a database to support operations at the Hote du Austria. A 1
description of the hotel follows: The hotel has three branches with all branches located in the same city. Each branch of the hotel has 100 rooms - (10 suites, 50 single rooms, 40 double rooms). Each branch of the hotel houses and manages a 4-star restaurant named Michelin, an entertainment lounge, a bar, a physical fitness room, a travel agency, a drugstore and a swimming pool for the guests. For branches, the information to be stored is the branch id (bid), branch location (b_locn) and branch manager (b_mgr). The travel agency which is named Travel City provides travel services for making local and international travel arrangements for guests and walk-ins. Guests visiting the travel services go to different branches of the hotel on different days depending on their convenience. They are assigned an ID and given a key card. Other guest information such as name address and phone are also stored. The drugstore, Trustworthy is open 24 hours a day, 7 days a week. It provides service to both guests and walk-ins. Lately, Trustworthy s managers have noticed that many customers go to more than one branch to fill their prescriptions. Since some customers have allergies or relevant medical conditions, it would be best for the managers of different branches to share information on the customer s medical history. Currently, the customers use cash or credit card (CC#, expiry) as a payment method, every time they encounter an expense at the hotel. One of the policies of management is to provide fast, convenient and unobtrusive service to customers such that a guest need not carry money to enjoy the hotel s amenities. In order to facilitate this policy, the management desires to include billing of meal, travel, drugstore, and entertainment expenses to the guest s room-bill as and when the expenses are incurred. Guests are shown a form that displays the invoice number (inv#), date (dt) and time (t) of the expense, the items & descriptions (item# & descr.) on the bill and the total amount. The management also desires to support instantaneous querying facility (on-line input with real time processing) of room bill status by management and authorized members of the staff. The new system should include a menu screen that can be used by the hotel receptionists to answer the following queries: 1) expenses by category such as pharmacy, restaurant etc. 2) a listing of current expenses and current total, 3) final bill showing all expenses and a grand total. Required: 1) FD diagram, 2) design 3) an explanation of how design meets requirements. Comment [WIU1]: Attributes of branch. Comment [WIU2]: What is this? Comment [WIU3]: Invoice eclass Comment [WIU4]: Derived attribute Comment [WIU5]: Requirements that need to be fulfilled by the design 2
LIST ECLASSES AND ATTRIBUTES Branch: bid, b_locn, b_mgr. Room: room#, type Facility: facility code, type, manager Guest: guest_id, name, address, ph Comment [WIU6]: Room# is assumed; type is single, double or suite Comment [WIU7]: These are assumed. Facility type is used to denote whether it is a pool, restaurant, bar etc. Credit card: cc#, name, exp_dt. Medical history: MH#, code, description, prescriptions. Payment method: cc#, exp_dt Expense: item#, dt, time, descr., amount, pmt_type Room bill: inv#, dt, t Comment [WIU8]: Item# has been added. Its an artificial key denoting list of expenses; dt and time have also been added to describe expenses. Comment [WIU9]: Total is a derived attribute not included here. FD DIAGRAM bid, room# -- type ; since there are three branches, we cannot assume room# s will be unique. Type is determined by the room# facility code ---- bid, type, manager; same comments as above apply; note also that a branch can have multiple facilities but each facility belongs to one branch. guest_id --- name, addr, ph; self evident MH#, code, description, prescriptions; lets keep things simple and assume one prescription per medical problem. cc# -- name, exp_dt; each cc has an owner and expiration date. item# -- dt, t, descr., amount pmt_type, facility code; facility code refers to whether it is a gymn, restaurant etc. inv# -- dt, t; invoice# determines date and time it is created. room#, dt -- guest_id; encodes relationship between rooms and guests 3
DESIGN Room (room#, type) Facility (facility code, type, manager) Guest (guest_id, name, addr, ph) Medical History(MH#, code, description, prescriptions, guest_id); guest_id is the cross reference key. Card(cc#, exp_dt, guest_id); -- guest id is a cross reference key; in fact if a 1:1 between Guest and Card can be assumed, they can be combined. Expense(item#, date, time, descr., facility code, amount, pmt method, room#, cc#, inv#); ---- room# & cc# are inserted as a cross reference key; this makes pmt_type redundant. But is kept in case it is cash. Note that guest_id then need not be incorporated as another cross reference key (it is already a foreign key in card). Expenses usually belong on a room bill. When data is entered, if the inv# is blank then it is an expense by a walk-in customer. An additional note field should make such things clearer. Room bill(inv#, dt, t, guest_id) guest_id is inserted as a cross reference key in recognition of relationship between guests and expenses. MEETING THE REQUIREMENTS The requirements are as follows: 1. Guest s medical history shared across branches -- There is a medical history table that can be accessed from any branch. 2. Billing of customer Customer can use any facility at any branch and can get charged for it. The charges are accumulated in the Expense table. The payment method can be cash, room# or cc#. Subtypes are poorly handled in design theory and we are seeing it here. 3. Final bill -- Invoice is dynamically created as a view by combining room bill with expenses using inv# as the cross reference key. 4. Grand Total -- The total amount is a derived field and is calculated in a form/report or through a separate query. 5. Room bill status -- the same info as above can also be queried at any time through a multi-table SELECT statement involving Expense and Room bill. tables. 6. Expenses by category Expenses can be sorted based on facility code attribute for requirements #3, #4 and #5 above. 4
Medical history is not shown to avoid overcrowding it would be shown where the dotted rectangle is located. 5