0% found this document useful (0 votes)
95 views2 pages

Comp1821 Notes

The document requests several reports from a sales database including top selling products and customers, monthly sales, top suppliers, and busiest days. It then provides the entity relationship diagram and descriptions for a sales database including customer, sales, product, and supplier entities with attributes like name, price, and address. The ERD is updated to better represent the many-to-many relationship between products and sales using an associative entity.

Uploaded by

Hari pro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views2 pages

Comp1821 Notes

The document requests several reports from a sales database including top selling products and customers, monthly sales, top suppliers, and busiest days. It then provides the entity relationship diagram and descriptions for a sales database including customer, sales, product, and supplier entities with attributes like name, price, and address. The ERD is updated to better represent the many-to-many relationship between products and sales using an associative entity.

Uploaded by

Hari pro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Management asks:

1) Top 10 selling products


2) Top 10 highest spending customers
3) Monthly sales
4) Top 10 suppliers (that supply the most products)
5) Busiest day in a week (most customers) - most number of TRANSACTIONS

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

ENTITY-RELATIONSHIP DIAGRAM (ERD) - Partially Done

+----------+ 1 M +-------+ M N +-------+ M


1 +----------+
| Supplier |----< SUPPLIES >----|Product|----< SOLD IN >----| Sales |-------
< BUYS >-------| Customer |
+----------+ +-------+ +-------+
+----------+

Customer-Sales is a 1-to-many relationship.


Product-Sales is a many-to-many relationship. ==> Need to fix this by
adding an ASSOCIATIVE ENTITY.
Supplier-Product is a 1-to-many relationship.

ENTITY-RELATIONSHIP DIAGRAM (ERD) - Completed

+----------+ 1 M +-------+ 1 M
+---------------+ M 1 +-------+ M 1 +----------+
| Supplier |----< SUPPLIES >----|Product|----< CAPTURED IN >----| Sales-
Details |---< CONTAINS >---| Sales |----< BUYS >----| Customer |
+----------+ +-------+
+---------------+ +-------+ +----------+

Sales-Details is an ASSOCIATIVE ENTITY.


Customer-Sales is a 1-to-many relationship.
Sales-SalesDetails is a 1-to-many relationship.
Product-SalesDetails is a 1-to-many relationship.
Supplier-Product is a 1-to-many relationship.

You might also like