Professional Documents
Culture Documents
Comp1821 Notes
Comp1821 Notes
Comp1821 Notes
Entity
------
customer
sales
product
supplier
Customer Entity
---------------
- Attribute: id - PRIMARY KEY (unique and cannot be empty/null)
- Attribute: IC
- Attribute: name
- Attribute: mobile
- Attribute: email
- Attribute: date of birth
- Attribute: address (composite attribute)
-> unit number
-> street name
-> post code
-> suburb
-> city
-> country
Sales Entity
------------
- Attribute: total paid (derived attribute)
- Attribute: product
- Attribute: quantity
- Attribute: price
- Attribute: number of products sold (derived attribute)
- Attribute: sales id/invoice number/transaction id/transaction number - PRIMARY
KEY
- Attribute: date
- Attribute: time
- Attribute: cashier
- Attribute: payment mode (multivalued attribute)
-> cash
-> voucher
- Attribute: discount
McD Receipt
Apple Pie x 2 (quantity)
McChicken x 4 (quantity)
Number of products sold (2)
Number of products sold (6)
Number of items sold (6)
Product Entity
--------------
- id - PRIMARY KEY
- name
- price
- sku (stock keeping unit)
- expiration date
- manufacturer
- inventory level
- waybill number
- dimension
Supplier Entity
---------------
- id - PRIMARY KEY
- name
- email
- address
- phone
+----------+ 1 M +-------+ 1 M
+---------------+ M 1 +-------+ M 1 +----------+
| Supplier |----< SUPPLIES >----|Product|----< CAPTURED IN >----| Sales-
Details |---< CONTAINS >---| Sales |----< BUYS >----| Customer |
+----------+ +-------+
+---------------+ +-------+ +----------+