









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 04: Database Design & Development Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Nguyen Van Son 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
Grade: Assessor Signature: Date: Lecturer Signature:
Assignment Brief and Guidance: You are employed as a Database Developer for a large IT consultancy company. The company has been approached by FPT Shop which is expanding due to the growth of the number of stores. FPT Shop is currently facing difficulties in dealing with managing the database from all shops on over country. It decided to develop a new database so that: users can register with their phone numbers as IDs and order or rate, comment for their bought devices, shop managers can take care for their stores and director board can view all data from all shops. You are tasked to select one of those systems to develop database for FPT Shop. Your tasks are to:
Assignment Brief 1 (RQF) ................................................................................................................. 2 Higher National Certificate/Diploma in Computing ...................................................................... 2 P1 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. ...................... 5 Task 1 - Statements of user and system requirements (P1) .............................................................. 5 1 .1. Overview about the Problem: ............................................................................................... 5 Introduction: ............................................................................................................................... 5 1.2. Requirements of the application: .......................................................................................... 5 Task 2 – Design the relational database system (P1) ........................................................................ 6 2.1 Analyse the requirements: ..................................................................................................... 6 2.2 Database design with explanations: ....................................................................................... 6 2.2.1. Logical Design: ................................................................................................................... 6 A. Identify entities: ...................................................................................................................... 7 B. Identify relationships: .............................................................................................................. 7 C. Identify and associate attributes with entities: ......................................................................... 7 ER diagram: ............................................................................................................................... 10 2.2.2. Physical Design:................................................................................................................ 12 REFERENCES .................................................................................................................................. 14
Figure 1: ER Diagram Figure 2: the relationship of ERD
Table 1: Identify entities Table 2: Identify relationships Table 3: Category Table Table 4: Product Table Table 5: Customer Table Table 6: Staff Table Table 7: Order Table Table 8: Order Detail Table
2.1 Analyse the requirements: To be able to design the database according to the requirements of the article, I use the Microsoft SQLServer database. The system has 4 user roles, including business processes for FPT Shop managers, directors board, and customers. This design is based on the request of FPT Shop. In this database design, there are 6 tables, each with different content to satisfy the requirements of the article. The six tables include: Product table, Category table, Customer table, Staff table, Order table, Order Detail table.
- The Category Table: is used to display each product category so that FPT Shop is easy to control and customers can easily find it. - Product Table: Displays all product-related information. - Staff Table: Display all staff information. - Customer Table: contains all information about the buyer of the product. - Order Table: contains information about the manufacturer who created the product, production date, and shipping time. - Order Detail Table: all information about a product, total amount, and price. 2.2 Database design with explanations: 2.2.1. Logical Design:
A. Identify entities: No. Entity Description 1 Category Table Contains category ID, and category name. 2 Product Table Contains product name, product ID, category ID, product type, and product items. 3 Staff Table Contains staff phone, staff addresses, and staff names, staff ID. 4 Customer Table Contains sex, date of birth, customer phone, customer address, and customer name, customer ID. 5 Order Table Contains order date, delivery date, customer ID, and staff ID. 6 Order Detail Table Contains order ID, product ID, amount B. Identify relationships: Entity Multiplicity Relationship Multiplicity Entity Product n Belong 1 Category Product 1 Have n Order detail Order detail n Have 1 Order Order n Have 1 Customer Staff 1 Have n Order C. Identify and associate attributes with entities: Category Table: Category Entity No. Attribute Description
1. Category ID Contains Category ID 2. Category Name Contains Category Name Primary Key: Category ID
Order Table: Order Entity No. Attribute Description
1. Order ID Contains Order ID 2. Order Date Contains Order Date 3. Delivery Date Contains Delivery Date 4. Staff ID (Foreign Key) Contains Staff ID 5. Customer ID (Foreign Key) Contains Customer ID Primary Key: Order ID Order Detail Table: Order Detail Entity No. Attribute Description 1. Order ID Contains Order ID 2. Product ID Contains Product ID 3. Amount Contains Amount Primary Key, Foreign Key 1: Order ID Primary Key, Foreign Key 2: Product ID
ER diagram: Figure 1: ER Diagram Explanation of ER Diagram: The above diagram has 6 tables where the OrderDetail entity is a separate entity with the relationship between 2 tables Order and Product. The above table all have the attributes listed above. There are 4 relationships between the 6 tables: Entities are linked to each other through 1 - n (1 - many) and n - 1 relationships.
2.2.2. Physical Design: Category Table No. Field name Data type Constraint Description
1. Category ID Int Primary Key Category unique ID 2. Category Name Nvarchar( 5 0) Null Category name Product Table No. Field name Data type Constraint Description 1. Product ID Int Primary Key Not Null Product unique ID 2. Product Name nvarchar(50) Null Product name 3. Product Type Varchar(50) Null Product type 4. Product Items Varchar(50) Null Product items 5. Category ID Int Foreign Key of Category Table, Null Category unique ID 6. Price Float Null Price of Product Order Table No. Field name Data type Constraint Description 1. Order ID Char(10) Primary Key, Not Null Order unique ID 2. Order Date Datetime Null Order Date 3. Delivery Date Datetime Null Delivery Date 4. Staff ID Char(10) Foreign Key of Staff Table, Null Staff unique ID 5. Customer ID Char(10) Foreign Key of Customer Table, Null Customer unique ID
Order Detail Table No. Field name Data type Constraint Description
1. Order ID Char(10) Primary Key, Foreign Key 1 Order unique ID 3. Amount int Not Null Amount 4. Product ID Char(10) Primary Key, Foreign Key 2 Product unique ID Customer Table No. Field name Data type Constraint Description 1. Customer ID Int Primary Key, Not Null Customer unique ID 2. Customer Sex Bit Null Sex of Customer 3. Date of Birth Date Null Date of Birth 4. Customer Address nvarchar(100) Null Customer Address 5. Customer Name nvarchar(50) Null Customer Name 6. Customer Phone Char(10) Null Customer Phone number Staff Table No. Field name Data type Constraint Description 1. Staff ID Int Primary Key, Not Null Staff unique ID 2. Staff Phone Char(10) Null Staff Phone number 3. Staff Mail Varchar(50) Null Staff Mail 4. Staff Name Varchar(50) Null Staff Name