Hoang Hai Long - 228146 - 0-Đã Chuyển Đổi
Hoang Hai Long - 228146 - 0-Đã Chuyển Đổi
Hoang Hai Long - 228146 - 0-Đã Chuyển Đổi
Unit number and title Unit 04: Database Design & Development
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P1 M1 D1
Summative Feedback: Resubmission Feedback:
2.1
With that growth, the question of how to manage your supermarket sales effectively and simply is a headache for many managers.
My iHub partner, they asked me to design a database to manage their goods, employees, and customers.
Figure 1
II Design a relational database system using appropriate design tools and techniques, containing at
least four interrelated tables, with clear statements of user and system requirements.
The database that stores employee information includes the following information: MANV (employee code), TENNV (employee
name), NGAYSINH (date of birth), DIACHI (address), SDT (phone number). Customers include the following information: MAKH
(customer code), TENKH (customer name), DIACHI (address), SDT (phone number). The invoice includes the following information:
SOHD (invoice number), NGAYLAPHD (invoice date), TENNV (employee's name), TENMH (product name), MAKH (customer
code). The item includes the following information: MAMH (item code), TENMH (product name), DVT (unit of calculation). Type of
goods includes the information: MALOAI (type code), TENLOAI (type name), DVT (unit of calculation). Area includes the
information: MAKV (area code), TENKV (area name).
The purpose of the system development was to make sales easily and easily retrieve customer information for the most
convenient machine maintenance.
Store management includes jobs such as sales, collecting money, daily income reporting, checking merchandise. Each time
transaction at the counter, employees must print invoices and give them to customers, then write the name of the product, quantity
and quantity so that at the end of the day, employees must summarize the revenue paid to the manager.
Updating and correcting information takes a long time because the customer's information is so much.
Safety is not high, not catching up with the technology of the times.
We need to help ihub improve a management system that is designed with full functionality and because of the above
disadvantages, a DATA BASED system needs to be built for more optimal management.
perform internal operations and use services provided outside the system.
- Employee manager
- Customer management
- Manage export and import
- Manage the stock and quantity of remaining stock
- Manage the sales per month of the supermarket
Non-functional requirements: are constraints and conditions for functional requirements of the system such as time constraints,
performance constraints, usage standards ... These requirements image affects the quality, usability of the system and has a direct
impact on user satisfaction, thus determining the success of the system.
Usability: is the level of use and the satisfaction of users such as: in accordance with needs; Easily to
learn how to use it; User interface; Ability to access and exploit;
Confidence: Mature; Ready; Fault tolerance; Resilience; Time between failures interrupt operation
of the system;
Pentium IV or higher.
IIILogical design.
- Staff
- Customer
- Bill
- Product
- Invoice details
Figure 2
Employee Entities:
Employees include the following information: FULLNAME (employee's name), DATE OF BIRTH (date of birth), ADDRESS
(address), PHONE (phone number).
Customer entity:
Customers include the following information: FULLNAME (customer name), ADDRESS (address), TELEPHONE (phone
number).
Invoice entity:
The invoice includes the following information: BILLID (invoice code), DATE (date of issue), STAFF (employee code),
CUSTOMERID (customer code).
Entity item:
Item includes the following information: ITEMID (product code), ITEMNAME (product name), AMOUNT (quantity).
Type of goods includes the information: ITEMID (item code), BILLID (invoice code), AMOUNT (quantity), PRICE.
Relationships of tables
The relationship between an employee and an invoice is a one-to-many relationship. Because an employee sells many bills, an
employee only prints one bill.
The relationship between a customer and an invoice is a one-to-many relationship. Because an invoice can only be purchased by one
customer. However, a customer can have multiple invoices.
The relationship between the invoice and the item is a many-to-many (n-n) relationship, not in compliance with the ERD's rules, so
I created a BILLDETAIL table to separate it into a One - Many ( 1-n) to provide hardness and accuracy in a database
creation.
IVExplanation.
1 Database Entity.
Database entity is a thing, person, place, unit, object or any item about which the data should be captured and stored in the form of
properties, workflow and tables. While workflow and tables are optional for database entity, properties are required (because entity
without properties is not an entity).
2 Relationship.
A relationship is established between two database tables when one table uses a foreign key that references the primary key of another
table. This is the basic concept behind the term relational database.
3 Explain my ERD.
EMPLOYEES, including the following entities:
STAFF TABLE.
Customer ID: This is the foreign key in the INVOICE table to refer to the Customer code in the Customers Table.
StaffID: This is a foreign key in the BILL table that displays the employee code in the employee.
Delivery Date: displays the date the customer receives the product
Figure 4
-
Figure 5
NameItem: Indicates the name of the item corresponding to the order number. Unit:
Figure 6
V Physical design
1 3NF Normalization.
Based on the ERD in the above section, the Database includes tables with the following relationships:
Table of employees
FULLNAMEST (nvarchar (50)), BIRTHDAY (smalldatetime) with born conditional date must be less than the current date 'Check
(BIRTHDAY <Getdate ())', ADDRESS (nvarchar (50)), TELEPHONE (nvarchar ( 20)).
Numerica Allow
Column Data Constraint
l order Nulls
Name Type s
1 MANV nvarchar(1 PK No
0)
2 HOTENNV nvarchar(5 No
0)
3 Address nvarchar(2 No
0)
4 SDT nvarchar(1 No
0)
Figure 7
Figure 8
Table of product
The Products Table: The Products Table is used to get product information about the products under the product. The Products table
has attributes (columns) such as product code, product name, product unit price, ... Details of the Products table are described in the
following table:
Figure 9
Figure 10
Table of Customer
Customers Table: The Customers table is used to identify customer information about customers that belong to customers. The
Customers table has attributes (columns) such as customer code, customer name, date of birth, address, phone number, email, ...
Details of the Customers table are described in the following table:
Numerical Column Name Data Type Constraint Allow
order s Nulls
1 MAKH nvarchar(10) PK No
2 HOTENKH nvarchar(50) No
3 DIACHI nvarchar(100) No
4 SĐT nvarchar(10) No
Figure 11
Figure 12
Bill of table
Invoice Table: Invoice table is used to bill fields. The invoice table has attributes (columns) such as invoice code, invoice date,
customer code, employee code, department, ... Invoice table details are described in the following table:
Numerica Allo
Column Data Type Constrain
l order w
Name ts
Nulls
1 MAHD nvarchar(10) PK No
2 MAKH nvarchar(10) No
3 MANV nvarchar(10) FK No
4 NGAYLA smalldatetim check(NGAYLAP<getd No
P e a te())
5 NGAYNHA smalldatetim check(NGAYLAP<getd No
N HANG e a te())
Figure 13
Figure 14
Invoice details table
Invoice Details Table: Invoice details table is used to invoice fields. Invoice DETAIL table has attributes
(columns) such as invoice code, invoice date, customer code, employee code, department, ... Invoice
table details are described in the following table:
Numerical Allow
Column Name Data Type Constraints
order Nulls
1 MAHD nvarchar(10) PK No
2 MASP nvarchar(10) PK No
3 DONVITINH nvarchar(10) No
4 SOLUONG int No
Figure 15
Figure 16
VI Diagram.
Figure 17
Index of comments
+ Weak points:
- There are some mistakes in the report such as: format, margin,…
+ Should do
- Study hard