Download Assignment 1 1622 database- grade (P-M-D) and more Assignments Information Technology in PDF only on Docsity!
ASSIGNMENT 1 FRONT SHEET
Qualification TEC Level 5 HND Diploma in Computing Unit number and title Unit 04: Database Design & Development Submission date 25/02/2023 Date Received 1st submission 25/02/ Re-submission Date Date Received 2nd submission Student Name Tran Duc Long Student ID GCH Class GCH1106 Assessor name Dinh Duc Manh 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 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date: Signature & Date:
- A. Introduction
- B. Task 1. Statements of user and system requirements
- 1.1. Overview about the Problem
- 1.2. Requirements of the application
- a. Business process...........................................................................................................................................................................
- b. Business rules
- c. Requirements
- d. User story
- e. Objectives (Things intended to achieve)
- f. Output
- C. Task 2. Design the relational database system
- 2.1 Analyse the requirements
- 2.2 Database design with explanations
- a. Logical design(ERD)
- b. ER diagram
- 2.3 Review whether the database is normalized
- a. First Normal Form (1NF).............................................................................................................................................................
- b. Second Normal Form (2NF)
- c. Third Normal Form (3NF)
- d. Conclusion
- 2.4 Data validation
- 2.5 Wireframe of the application
- 2.6 Evaluation
- a. Advantage
- b. Disadvantage
- c. Future development plans
- D. Conclusion
- E. References
- Picture 1: Information of Customer Table of picture
- Picture 2: Information of Staff
- Picture 3: Information of Products
- Picture 4: Information of Orders..................................................................................................................................................................................
- Picture 5: Top 5 Customers spend the most in the year
- Picture 6: Top 5 Products purchased the most in the year
- Picture 7: Top 5 staffs sell the most in the year
- Picture 8: Entity-relationship diagram at the conceptual level
- Picture 9: Complete Entity Relationship Diagram........................................................................................................................................................
- Picture 10: Login interface
- Picture 11: Main layout
- Picture 12: Menu of View option
- Picture 13: Example of View Customer List Layout
- Picture 14: Menu of add options
- Picture 15: Example of Add new Staff Layout..............................................................................................................................................................
- Picture 16: Menu of Update options
- Picture 17: Update Customer layout
- Picture 18: Menu of Statistic options
B. Task 1. Statements of user and system requirements
1.1. Overview about the Problem
FPT Shop is now experiencing difficulty in processing the database from all of its locations around the country, which is increasing as the number of stores grows which is expanding due to the growth in the number of stores. FPT shop approached my firm and requested assistance. I decided to create a new database where people may register using their phone number or email address as their ID and place an order. Each consumer will be assigned a caregiver, and each staff will report to their management. This will assist FPT Shop in managing all data ranging from staff to customers, as well as new or additional items to the organization. As a result, in order to create a new database, I need to understand the needs of consumers, users, and staff while signing into the application and ordering and reviewing items. Customer information will also be kept safe and secure, staffs and manager, who will oversee everything to ensure that the application always fulfills the user's requirements.
1.2. Requirements of the application
a. Business process
- Clients and employees can access the application by inputting login information in the login screen. After logging in, customers and employees may enter their information to implement options.
- Customers who wish to swap products and information must submit a request to management in order for the exchange customer and their information to be accepted.
- Once a consumer puts an order, the staff will review the order, its progress, and the client's order notes. Managers and directors may also access all data on customers, staffs, or goods, as well as statistics on which customers purchase the most, which items sell the best, and which employees are the best.
b. Business rules
- Customer, staffs, managements, accountants and directors must use a phone number or email account to log in to the application. Customers are unable to change their own information or orders.
- Staff can view order advice for customers
- The manager can edit the information of the order as well as the customer. If customers want to change. They will have logged in and place an order will receive an email with a request to amend the information.
If the request is approved by the management, the client may modify the information or erase it and reinstall a new one. (Management has only 24 hours to approve or decline the request).
- The accountant can view the store's sales statistics so that they can be submitted to the management.
- The board of directors will look at the statistics of the accounting reports, then apply the reward policy for employees as well as apply discount codes to customers.
c. Requirements
➢ The database that is developed must fulfill fundamental criteria such as ease of access, storage, management, and updating. The system must also assure the database's security. At the same time, they must satisfy all of the scenario's criteria. ➢ Functional requirements:
- Customer: o Customers may order products. o After logging in, the customer may examine product information and provide it. o Once the manager accepts that need, the customer can add information to the order product and delete that information.
- Staff: o Employees login app and can access just product and order of client. o Employees can change order status. o Employees can view customer information.
- Manager: o Administrators can accept requests to alter client information. o A manager can manage many staffs and can keep information. o Managers have the ability to regulate product, add product, and delete product. o Managers can also edit or delete information of employees as well as customers.
- Product: o When a valuable product is brought to the store, it must have a distinct brand.
Picture 1 : Information of Customer Picture 2 : Information of Staff Picture 3 : Information of Products
Picture 4 : Information of Orders Picture 5 : Top 5 Customers spend the most in the year Picture 6 : Top 5 Products purchased the most in the year
✓ Discounts: includes time-limited discount codes. o About productions: ✓ Products: displays all info associated with the product. ✓ Categories table: used to display all product categories to assist FPT Shop in controlling and following consumers. ✓ Brands: contains brands associated with each FPT store goods.
2.2 Database design with explanations
a. Logical design(ERD)
Identify relationships: Identify and associate attributes with entities
Staffs entity No Attribute Decription 1 StaffId Contains staff’s Id 2 FirstName Contains staff’s FirstName 3 LastName Contains staff’s LastName 4 MidName Contains staff’s MidName 5 Status Contains staff’s status 6 PhoneNumber Contains staff’s number phone 7 Email Contains Staff’s email 8 ManageId Contains Staff’s Id manager Primary key: StaffId, Foreign key: ManageId Orders entity No Attribute Decription 1 OrderId Contains order’s Id 2 CreateDate Contains order’s created date 3 RequireDate Contains order’s required date 4 ShippedDate Contains order’s shipped date 5 OrderStatus Contains order’s status 6 CustomerId Contains customer’s Id 7 StaffId Contains staff’s Id 8 OrderItemId Contains orderItem’s Id Primary key: OrderId, Foreign key: CustomerId, StaffId, OrderItemId
Products entity No Attribute Decription 1 ProductId Contains product’s Id 2 Name Contains product’s name 3 Price Contains product’s price 4 BrandId Contains brand’s Id 5 CategoyId Contains category’s Id Primary key: ProductId, Foreign key: BrandId, CategoryId Brands entity No Attribute Decription 1 BrandId Contains brand’s Id 2 Name Contains brand’s name Primary key: BrandId Categories entity No Attribute Decription 1 CategoryId Contains brand’s Id 2 Name Contains category’s name Primary key: CategoryId
b. ER diagram
Picture 8 : Entity-relationship diagram at the conceptual level
- Description of the ER diagram: The diagram above has 8 entities that are related to one another, with the OrderItems entity being distinct from the link between the two segments sales and productions. The above entities all have the attributes listed above.
- There are 8 relationships between 8 entities: o Customer and Orders (1 - m): 1 customer can place multiple orders but those orders can only be ordered by 1 customer. o Staff and Orders :(1 - m) 1 staff can create multiple orders but those orders can only be created by 1 staff. o Staffs and Staffs (1-m): 1 manager can manage many employees but the employees can only be managed by 1 manager. o Orders and OrderItems (1 - m): An orders can belong to more than 1 items of order items if the orders contains more than 1 products, but each items in the order items is only related to one order. o Discount and OrderItems(1-m): 1 discount code can be applied to multiple items but 1 item can only contain 1 discount code. o Product and OrderItems(1-m): 1 product can have multiple items but those items can only be selected by 1 product. o Brands and Products(1-m): 1 brand can have multiple products but those products can only be contained by 1 brand. o Categories and Products(1-m): 1 category can have multiple products but those products can only be had by 1 category.
2.3 Review whether the database is normalized
- Database normalization is a method for structuring data in a database. Normalization is a method of dissecting tables in a systematic way to minimize data redundancy (repetition) and undesired features such as Insertion, Updating, and Deletion Anomalies. It is a multi-step method that converts data into tabular format while deleting duplicates from relation tables. (Anon, n, d)
- Normalization is mostly used to eliminate duplicate (useless) data.
- Assuring that data dependencies make sense, i.e. that data is stored properly.
- Common types of data normalization: a. First Normal Form (1NF) o To be in the First Normal Form, a table must meet the four conditions outlined below: ▪ It should only contain attributes/columns with single (atomic) values. ▪ Column values should be from the same domain. ▪ A table's columns should all have distinct names. ▪ And the sequence in which data is stored is irrelevant. o Example: ✓ The Staff table is not in 1st normal form because it contains the multivalued attribute PhoneNumber column: StaffId Name Status Email PhoneNumber 1 Trần Đức Long Working [email protected] 0327268237, 0945848855 2 Nguyễn Tiến Đạt Working [email protected] 0912552226 3 Nguyễn Vân Ly Working [email protected] 0976123123, 0902123123 ✓ To return the above table to 1NF, we separate each value into a row as follows: StaffId Name Status Email PhoneNumber 1 Trần Đức Long Working [email protected] 0327268237 1 Trần Đức Long Working [email protected] 0945848855 2 Nguyễn Tiến Đạt Working [email protected] 0912552226 3 Nguyễn Vân Ly Working [email protected] 0976123123 3 Nguyễn Vân Ly Working [email protected] 0902123123 b. Second Normal Form (2NF) o In order for a table to be in Second Normal Form, ▪ It must be written in the 1NF.