Docsity

asm1-1622- Database Design & Development, Assignments of Database Programming

Toggle sidebar
bg1
Higher Nationals in Computing
Database Design and
Development
ASSIGNMENT
No.1
Learner’s name:
Assessor name: NGUYEN VAN SON
Class:
Learner’s ID:
Subject’s ID: 1622 (Database Design & Development)
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download asm1-1622- Database Design & Development and more Assignments Database Programming in PDF only on Docsity!

Higher Nationals in Computing

Database Design and

Development

ASSIGNMENT

No. 1

Learner’s name:

Assessor name: NGUYEN VAN SON

Class:

Learner’s ID:

Subject’s ID: 1622 (Database Design & Development)

Assignment due: Assignment submitted:

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

 Summative Feedback:  Resubmission Feedback: \

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:

  • Work with FPT Shop to find out about current requirements for each system
  • Analyse the requirements and produce clear statements of user and system requirements.
  • Design a relational database system using appropriate design tools and techniques
  • Develop a fully functional relational database system, based on an existing system design.
  • Test the system against user and system requirements.
  • Produce technical and user documentation Part 1 (Assignment 1) Before you start the development process, your manager has asked you to produce a report for the CEO of FPT, containing:
  1. Clear statements of user and system requirements. The system must have at least 3 user roles, including business processes and statistical reports for FPT Shop managers.
  2. The design of the relational database system using appropriate design tools and techniques. It should contain at least four interrelated tables. You would prefer to produce a more detailed document, so you will produce a comprehensive design for a fully functional system which will include interface and output designs, data validations and cover data normalization. Your manager would like on the report your assessment of the effectiveness of the design in relation to user and system requirements. Learning Outcomes and Assessment Criteria (Assignment 1): Learning Outcome Pass Merit Distinction LO1 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. M1 Produce a comprehensive design for a fully functional system which includes interface and output designs, data validations and data normalisation. D1 Assess the effectiveness of the design in relation to user and system requirements.

Table of Contents

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

List of Figures

Figure 1: ER Diagram Figure 2: the relationship of ERD

List of Tables

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

  • With the Board of Directors: can log in, view information about product categories, product types, items, prices, customers, information about customers, executive management, staff, and system operation import and export system, create new, delete, add and remove easily.
  • with Manager: who can view information about customers, products, product quantities, prices, and operating staff, can only add or remove necessary information.
  • with Customers: people buy products and experience services, and information is stored in the system.
  • with Staff: the person who advises customers to buy and choose products, the creator enters, deletes and adds information of customers and products they buy into the system.

Task 2 – Design the relational database system (P1)

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.

  • Relationship between Category and Product (n – 1): Multiple products can have the same category and the category can contain many products, and partnerships with many possibilities because a product belongs to a certain category and a particular category has a large number of items. The product belongs to a certain category.
  • Relationship between Customer and Order (1 - n): 1 customer can place many orders but those orders can only be placed by 1 customer. A multiple-choice relationship because the relationship belongs to a single customer and a customer can place multiple orders at the same time.

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