10Figure 9 Relationshop of Customer table and Orders table.... 10Figure 10 Relationshop of Staff table and Orders table.... 11Figure 11 Relationship of Drug table, order table and order
Trang 1ASSIGNMENT 1 FRONT SHEET
Trang 3❒ Summative Feedback: ❒ Resubmission Feedback:
Signature & Date:
Trang 5ASSIGNMENT 1:
DATABASE DEVELOPMENT
Table of Contents
I STATEMENTS OF USER AND SYSTEM REQUIREMENTS 4
1 Overview of the problem 4
2 About this project 4
II Design The Relational Database System 5
1 Analyse the requirement 5
2 Database Design with Explanations 5
Figure 1 ERD For Pharmacy System 6
Figure 2 Information of customer 7
Figure 3 Information of orders 7
Figure 4 Information of orders details 8
Figure 5 Information of drug 8
Figure 6 Information of staff 9
Figure 7 Information of branch 9
Figure 8 Information of inventory 10
Figure 9 Relationshop of Customer table and Orders table 10
Figure 10 Relationshop of Staff table and Orders table 11
Figure 11 Relationship of Drug table, order table and order table order details 12
Figure 12 Relationship of Branch table, Inventory table and drug 13
Figure 13 Relationship of Branch table, staff table 14
Trang 6Figure 15 Orders table 15
Trang 7Figure 18 Order details table 16
Figure 19 Customer table 17
Figure 20 Branch table 17
Figure 21 Database diagram 19
I STATEMENTS OF USER AND SYSTEM
REQUIREMENTS.
Currently, I am working as a programmer at a technology company This project is a company project The customer asked the company to make a store management software for sale Include activities that make it easier for the store to manage drug sales eg staff management, drugs and prices, inventory, order management…
The pharmacy management system has 3 main roles: Staff management, drug management and orders management
As pharmacist management:
➢ I want to add and edit the Staff information or delete the Staff information when they no longer work at the store
As drug management:
➢ I see what drugs are in the store and the different names of them
➢ I want to add and delete drug information such as drug name or price of each drug
Trang 9II Design The Relational Database System
According to a recent survey of pharmacies, It is difficult for pharmacies to manage their drugs as well as their orders and Staff, especially inmedium to large drugstore chains for the following reasons:
➢ The amount of medicine is too many different names and many specific types of treatment for other diseases
➢ Staff in medium to large systems are many, difficult to manage, besides there will be cases where these pharmacists leave work and newStaff come back to work, it will be very difficult to manage if it happens often
➢ Customers often buy many products at the same time It will be tough for them if they have to wait for the staff to calculate, not to mention that a customer shop is crowded and they buy many medicinal products, they will wait a long time, and their experience at the store will not besatisfactory they will complain about their uncomfortable experience
Because of the above inadequacy, the store decided to create a management system to better manage its drugs and employees as well asincrease a better customer experience Attract more new customers, increase store revenue
➢ Relationship diagram:
Trang 11➢ Explanation for ERD: This is ERD include 7 tables with saved values for date needed system
Customer table: This table contains the primary key and table’s attributes like full name, email, and phone number These attributes
Trang 13Order table: This table contains the primary keys and two foreign keys including customer_id, and staff id Contain table
attributes like Description and Date orders
Figure 3 Information of orders
Orders Details table: This is the intermediate table connecting the order table and the drug table this table has orders_id, drug_id,
Trang 15Drug table: This table contains the primary key and Drug_Name, Price is attributes like information and price of the drug.
Figure 5 Information of drug
Trang 17Branch Table: This table contains primary key, and attributes such as the name and address of Branch.
Trang 19Explaning Relationship:
Trang 21Relationships of Staff table and Order table:
Figure 10 Relationshop of Staff table and Orders table
• Staff table and Order table: The relationship of the staff table and the order table is a one to zero or many relationships, a Staff can have
Trang 23Figure 11 Relationship of Drug table, order table and order table order details
Trang 27One - many relationships.
Figure 13 Relationship of Branch table, staff table
Two tables are linked by Branch_ID because one staff works only in a branch and a branch may have many staff.The relationship is one – much
Data type:
- Staff:
Trang 29- Orders:
Trang 31-Figure 16 Inventory table
- Drug:
- Order details:
Figure 17 Drug table
Figure 18 Order details table
Trang 33
Branch:
Figure 20 Branch table
Datase diagram: Tables, attributes, and linkages are common components of both ERD and database diagrams, as seen
in the database diagram figure above The ERD, on the other hand, clearly depicts the primary and foreign keys so that the reader may comprehend them The framework Finally, the database diagram retains all of the key elements of the