1stpart Database Assignment
1stpart Database Assignment
1
2. EERM
2.1 Assumptions:
According to the given scenario, different assumptions were made according
to the understanding of the case study given as follows:
Headingley Trading PLC, a mail order company sales agent base
catalogues through agents.
Headingley Trading PLC, Agent contacts directly to customer to sell the
products and each sale gets commission as per the discount
categories.
Payments are done through credit cards and traditional periodic
payment system.
Customer information is maintained for mailing marketing and to
recognize credit card customer and an agent support customer.
The company headquarter is in Leeds with central depot as
Birmingham that supplies regional depots
The agent organization has general sales manager and under which
has four divisions.
Each Division has number of regions and a larger region has more
than one depot.
2
Customer balance sheet maintained for the note of faulty good credit
and short delivery notice to customer if necessary.
Order processing system operates on a centralized computer.
In the basis of assumptions from the case study of Headingly Trading PLC, the following
extended entity relationship diagram has been prepared using QSEE tool as shown in
fig.1.1.
3
2.3 List your attributes and identifiers here:
2. Agent
Agent_id
Agent_first_name
Agent_last_name
Agent_enroll_date
Agent_address
Agent_contact_number
Agent_citizenship_number
Agent_email_address
Customer_id
3. Product_catalogue
Product_catalogue_id
Product_catalogue_code
Product_catalogue_description
Product_catalogue_image
Product_offer
Order_line_id
Product_id
4
4. Product
Product_id
Product_code
Product_description
Product_price
Product_cost
Prduct_mailing_code
Product_weight_gram
Product_annual_sales_goal
Product_line_name
5. Product_line
Product_line_name
Product_line_annual_sales_goal
6. Order
Order_number
Order_placement_date
Order_fulfillment_date
Customer_id
Stock_id
7. Order_line
Order_number
Product_id
Order_qty
Shipping_country
Shipping_zip_code
Shipping_address
Special_instruction
8. Invoice
Invoice_id
Order_number
Invoice_date
5
9. Payment
Payment_id
Invoice_id
Payment_type
Payment_date
Payment_amount
10. Customer_balance_sheet
Customer_balance_sheet_id
Invoice_id
Credit
Debit
Transaction_type
Date_sent
Credit_limit
Balance
11. Back_order
Back_order_id
Order_return_date
Return_qts
Order_id
12. Stock
Stock_id
Stock_qts
Stock_name
Product_code
Order_id
Back_order_id
13. Stock_pricing_history
Stock_pricing_history_id
Stock_date
Purchase_rate
Stock_id
6
14. Region
Region_id
Region_name
Region_address
Division_id
15. Division
Division_id
Division_name
Region_id
16. Office
Office_id
Department
Division_id
Supplier_id
17. Supplier
Supplier_id
Supplier_code
Supplier_name
Supplier_mailing_code
Supplier_address
Supply_date
Supplier_product
Supplier_product_rate
Supplier_line_id
18. Supplier_line
Supplier_line_id
Supplier_line_name
Supply_date
19. Central_depot
Central_depot_id
Depot_name
Depot_address
Supplier_id
7
20. Regional_depot Region_depot_id
Depot_name
Depot_type
Depot_address
Depot_consignment_id
21. Van
Van_id
Van_number
Van_driver_licence_number
Depot_id
22. Ship
Ship_id
Ship_number
Shipping_dateandtime
Ship_address
Depot_id
23. Depot_consignment
Depot_consignment_id
Ship_id
Van_id
Invoice_id
24. Discount_structure
Dis_id
Dis_for_agent
Sales_threshold
Oldstock_target
Targeted_discount
dateandtime
Comment
8
2.4 Validation Questions
Does the model list the agent based customers and customers without agents?
Is the Payment done for the order reliable via credit card or debit card?
Does the model list the discount strategies for the customers and agent?
Can the model provide the expected sales of each product in month?
Can the model provide monthly report of the order taken?
Can the model provide the sales statistics for each product category for effective
discount strategies?
Can the model manage the time of purchase and unique quote for each product?
Does the price of purchase order remain same from the price of order time?
Do the customers get the invoice on delivery of the order or not?
Is there any discount structure based on product categories or catalogue?
Agent: Agent holds the detail of the person working in different regions
and contact with customer group for the sales of the product as per the
sales agent gets the commission for each product sales including
different discount categories or structures.
9
Customer_balance _sheet: It includes the balance sheet of the
customer for the collection of transactional history data of the
customer.
Back_order: The details of product that are returned or were damaged
when a customer received the order and comment of the product for
maintaining the stock and also the customer balance sheet.
Stock: The number of product remained and the damaged stock is
maintained.
Stock_pricing_history: The detail historical data for the stock price
according to the date.
Region: It is a division through geographical areas.
Division: The geographical separation of Office.
Office: The headquarters that lies in Leeds of Whilst Headingly
Trading PLC Company.
Suppliers: The different vendors who supply their products for sales
via Headingley Trading PLC Company.
Supplier_line: The supplier line consists of the date of supply with
monthly sales of specific supplier company.
Depot: The central depot Birmingham supplies the regional orders and
stock items or products. The regional stock house distribute the order
items according to the agent id and customer shipping information.
Van: The delivery of items through road transportation.
Ship: The delivery of items through the water transportation.
Depot_consignment: The details on the basis of delivery and order
date and conformation of customer getting order items.
According to the case study of the Headingly Trading PLC Company the
occurrence of the entity are drawn as follows:
Enitity: Customer
custo customer_fi customer_last customer custo Contact_n Country zip_code email-
mer_i rst_name _name _address mer_c o address
d ity
10
3. Normalisation
Normalised Forms found in the Appendix – each form individually
11
Date Sent Discounted Price Agent ID Quantity t
Date Sent Discounted Price
Product code Depot
Quantity consignment(FK)
12
VAT class Unit Price VAT class Invoice Code
Discount Code VAT class Mailing Code Unit Price
Discount Code VAT class Stock
Depot No. Depot No. Discount Code Location
No.
Stock Location No. Stock Location No. Discount Code
Quantity in Stock Quantity in Stock Stock Location No.
Depot No.
Daily Usage Daily Usage Quantity in Stock
Re-order level Re-order level Daily Usage Stock Location No.
Re-order
Maximum Stock Maximum Stock Depot No. Quantity in Stock level
level level Re-order level Daily Usage
Valuation Valuation Maximum Stock Depot No.(FK)
level
Valuation Re-order level
Maximum Stock
level
Valuation
13
Customer No. Customer No. Customer No. Customer No. Customer
Customer Name Customer Name Customer Name Customer Name No.
Balance Balance
Date Date Agent No. Agent No. Customer
balance
Reference Reference Agent Name Agent Name sheet
Debit($) Debit($)
Credit($) Credit($) Customer Customer balance Payment
Trans Type* Trans Type* balance sheet sheet
Date Date
Reference Reference
Debit($) Debit($)
Credit($) Credit($)
Balance Balance
Payment Payment
Trans Type* Trans Type*
14
4. COMPOSITE EERD (based on top-down and bottom up
approaches) – using QSEE.
4.1. Composite EERD diagram
The fig1.1 of mail order company was drawn as the top down approach where
Depot were separated and was unable to get the details of transportation
information from the central depot where here it has the proper information of
van delivery and ship delivery from central as well as regional depot. Here the
agent commission entity was included so that it could make easy for agent
commission as well as the performance of agents. The log_in entity was
included so that it could help mail the customer about any notice as well as
update about new offers and products. In second sections, form normalization
was done through which multiple tables were created where the changes
seems to be needed for the better EERD diagram planning from early top
down approach. Hence, the changes in first EERD has been done in the
15
Fig.1.2 EEER diagram above.
4.2 FINAL LIST OF tables and attributes, defining all Primary Keys and
any Foreign Keys(s) derived from the Composite EERD
26. Agent
Agent_id
Agent_first_name
Agent_last_name
Agent_enroll_date
Agent_address
Agent_contact_number
Agent_citizenship_number
Agent_email_address
Customer_id
28. Product_catalogue
Product_catalogue_id
Product_catalogue_code
16
Product_catalogue_description
Product_catalogue_image
Product_offer
29. Product
Product_id
Product_code
Product_description
Product_price
Product_cost
Prduct_mailing_code
Product_weight_gram
Product_annual_sales_goal
Product_line_name
30. Product_line
Product_line_name
Product_line_annual_sales_goal
31. Order
Order_number
Order_placement_date
Order_fulfillment_date
Customer_id
Stock_id
32. Order_line
Order_number
Product_id
Order_qty
Shipping_country
Shipping_zip_code
Shipping_address
Special_instruction
17
33. Invoice
Invoice_id
Order_number
Invoice_date
34. Payment
Payment_id
Invoice_id
Payment_type
Payment_date
Payment_amount
35. Customer_balance_sheet
Customer_balance_sheet_id
Invoice_id
Credit
Debit
Transaction_type
Date_sent
Credit_limit
Balance
36. Back_order
Back_order_id
Order_return_date
Return_qts
Order_id
37. Stock
Stock_id
Stock_qts
Stock_name
Product_code
Order_id
Back_order_id
18
38. Stock_pricing_history
Stock_pricing_history_id
Stock_date
Purchase_rate
Stock_id
39. Region
Region_id
Region_name
Region_address
Division_id
40. Division
Division_id
Division_name
Region_id
41. Office
Office_id
Department
Division_id
Supplier_id
42. Supplier
Supplier_id
Supplier_code
Supplier_name
Supplier_mailing_code
Supplier_address
Supply_date
Supplier_product
Supplier_product_rate
Supplier_line_id
43. Supplier_line
Supplier_line_id
Supplier_line_name
Supply_date
19
44. Depot
Depot_id
Depot_name
Depot_address
Depot_type
Supplier_id
Region_id
45. Van
Van_id
Van_number
Van_driver_licence_number
Depot_id
46. Ship
Ship_id
Ship_number
Shipping_dateandtime
Shipping_address
Depot_id
47. Depot_consignment
Depot_consignment_id
Ship_id
Van_id
Invoice_id
48. Discount_structure
Dis_id
Dis_for_agent
Sales_threshold
Oldstock_target
Targeted_discount
dateandtime
Comment
20
5. Physical Design Discussion
6. Bibliography
Harvard style
Lindblad, M. and Seidel, M. (2019). Database Uses in Business.
[online] Smallbusiness.chron.com. Available at:
https://smallbusiness.chron.com/database-uses-business-
64298.html [Accessed 23 Apr. 2019].
Lee, G. (2019). List of U.S. Mail-Order Companies. [online]
Smallbusiness.chron.com. Available at:
https://smallbusiness.chron.com/list-us-mailorder-companies-
13448.html [Accessed 23 Apr. 2019].
7. Appendixes
21