Hoosier Burger Case Exercises Solutions
a. Based on the information provided in the case scenario, what entities will Hoosier Burger need to store information about?
As illustrated in Figure 7–10, Hoosier Burger currently stores information about its sales, item sales, products, recipes, inventory items, invoice items, and invoices. The new delivery system will require information about charges, delivery customers, and order histories.
b. For the entities identified in part a, identify a set of attributes for each entity.
A suggested answer is provided below.
SALE(ReceiptNumber, SaleDate, Delivery)
ITEMSALE(ProductID, ReceiptNumber, QuanitySold)
RECIPE(ItemNumber, ProductID, QuantityUsed)
INVENTORYITEM(ItemNumber, ItemDescription, QuantityinStock, TypeofItem, MinimumOrderQuantity)
INVOICE_ITEM(ItemNumber, VendorID, InvoiceNo, QuantityAdded)
INVOICE(VendorID, InvoiceNo, InvoiceDate, Paid?)
CHARGE(ReceiptNumber, CustomerID, Amount, Date)
CUSTOMER(CustomerID, BillingAddress, DeliveryAddress, PhoneNumber, FaxNumber)
c. Specify an identifier for each entity. What rules did you apply when selecting the identifier?
The identifiers are noted in the previous answer. Four rules were mentioned in the chapter; these include: (1) choosing a candidate key that will not change its value over the life of each instance of the entity type; (2) choosing a candidate key such that, for each instance of the entity, the attribute is guaranteed to have valid values and not be null; (3) avoiding the use of intelligent keys; and (4) considering the substitution of single-attribute surrogate keys for larger composite keys.
d. Modify Figure 7–10 to reflect the addition of these new entities. Be sure to specify the cardinalities for each relationship.
A suggested answer is provided below. Microsoft Visio was used to prepare the E-R diagram.