Sie sind auf Seite 1von 4

Question 5

The Hotel1401 hosts many guests in a year. For the longest time, it had manually kept track of
perishable products. But the manual method of inventory keeping is inefficient and error prone.
Hotel1401 now requires a database to manage its suppliers, products and capture relevant data
about the order of goods for monitoring purposes. In particular, data about the suppliers,
products, order and the employees in-charge of ordering need to be captured.

When an employee orders products from a supplier, the employee is required to key-in a
unique identification number, designation (e.g. executive or clerk), department (e.g. Kitchen or
Housekeeping) and an office telephone number.

Common perishable products include milk, vegetables and meat. Products are uniquely
identified by a SKU (i.e. stock keeping unit). Other details of products that need to be captured
include product description and Best Before Date.

Suppliers provide Hotel1401 with the products that are required. Each supplier is uniquely
identified by a SN (i.e. Supplier Number). Other details about suppliers that Hotel1401 would
like to capture and use include supplier address, reputation of supplier and remarks. Remarks
are general notes entered by employees about the supplier, such as Very difficult to negotiate
with or Likes to give free gifts.

Each order must include necessary and important information about the supplier, products and
the employee raising the order. In addition, Hotel1401 would also like to include the date of
the order. Every order must be raised by only one employee but an employee may raise
multiple orders. A supplier may be listed in more than one order. Similarly, a product may be
listed in many orders. An order may also contain a list of products to be ordered from a
particular supplier. Sadly, some employees never get to raise an order.

Required

a. Draw an Entity-Relationship Diagram (ERD) for the above database.


(8 marks)

b. Draw the corresponding database schema. Include all attributes listed in the case above
making sure that the intersection table (if any) contains at least 1 non key attribute.
(7 marks)

(Total: 15 marks)
Suggested Answer

ERD

Note:
While the schema is acceptable to me (with minor changes made), again we have a flawed
ERD. Please correct the ERD yourself keeping in mind that:

a. The relationships are not named


b. At least one assumption is lacking, which is required in this case
c. The connectivity between Suppliers and Orders, at the Suppliers side may be
many depending on your assumption. I would think that many should be a
reasonable assumption which in this case is not
d. Why is the participation optional between Orders and Products at the Products
side? An order without any products?
e. The case said When an employee orders products from a supplier, the employee
is required to key-in a unique identification number, designation (e.g. executive or
clerk), department (e.g. Kitchen or Housekeeping) and an office telephone
number. And it ends with Sadly, some employees never get to raise an order..
So is the Employees table supposed to capture only data of employees who have
actually placed an order or the names of ALL employees? I think it should be the
formal which makes the last statement Sadly, . redundant! And therefore the
connectivity and participation between Orders and Employees at the Orders side
looks okay. But whats with the optional participation at the Employees side?
An order that is raised by no one?

Database Schema:

Suppliers[SN, S_Add, Rep_Supp, Remarks]


Orders[ON, NRIC, SN, O_date]
Employees[NRIC, Designation, Department, Tel]
Products[SKU, Prod_Des, BBD]
Orders-Products[ON, SKU]
Question 6

A modernized money changer Akshays Exchange at Marina Bay copies its daily exchange
rate table from Bloombergs currency web page and pastes it into his own Excel table as shown
below. When customers enquire about exchange rate amounts, Akshay enters the amount of
source currency into cell G1, the source currency unit in cell G2, and the target currency unit in
cell G3. For example, if a customer asks how much Singapore dollar do I get if I exchange
USD100?, Akshay will enter 100 into G1, USD into G2, and SGD into G3. Because of
Akshays ingenious formula in G4, the converted amount, always up-to-date and always
accurate based on the table, will be shown in G4. The table below illustrates this example.

Akshay is experienced enough to always enter correctly, in capital letters, the currency
acronyms in cells G2 and G3. Sometimes, however, he may make a typo, such as UDD in
G2 or G3, and in such cases, G4 will nicely show N.A.. Akshay has also smartly used the
one-way exchange rates for two-way exchanges, no matter how Bloomberg re-orders the
currency names. For example, for Australian dollar, the table shows the rates for AUD-USD,
not USD-AUD, whereas for Singapore dollar, the table shows USD-SGD instead. Akshay is
not worried even if Bloomberg changes the order and starts showing SGD-USD the next day
his formula in G4 will handle this just as well. Amazing!

(a) What is the exchanged amount in G4 if a customer exchanges SGD100 into USD?
(2 marks)

ANSWER:
G4 80.0448251
Calculated from 100/(1.2493)
(b) Using ONLY the functions VLOOKUP and IFERROR, compose Akshays formula in G4.

ANSWER:
G4 =IFERROR(VLOOKUP(G2&"-"&G3,$A$7:$B$19,2,0)*G1,
IFERROR(G1/VLOOKUP(G3&"-"&G2,$A$7:$B$19,2,0),"N.A."))

Das könnte Ihnen auch gefallen