Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

ASSIGNMENT 2 FRONT SHEET

Qualification TEC 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 Nguyen Huu Hoang Khanh Student ID GCD220223

Class GCD22HL01 Assessor name Phan Thanh Tra

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

P2 P3 P4 P5 M2 M3 M4 M5 D2 D3
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:
Contents
CHAPTER 1 – DEVELOP THE DATABASE SYSTEM ...................................................................................................................................... 4
I. Introduction .............................................................................................................................................................................................. 4
II. Develop the database system ..................................................................................................................................................................... 5
1. ERD ..................................................................................................................................................................................................... 5
2. Mock-up of the application ................................................................................................................................................................... 6
CHAPTER 2 – PRODUCES QUERIES: ..............................................................................................................................................................21
CHAPTER 3 – TEST THE SYSTEM: ..................................................................................................................................................................33
I. Flow chart................................................................................................................................................................................................33
II. User instructions ......................................................................................................................................................................................34
III. Test cases ............................................................................................................................................................................................35
IV. Conclusion ...............................................................................................................................................................................................36
CHAPTER 1 – DEVELOP THE DATABASE SYSTEM
I. Introduction
In this report, I will cover the application mock-up, database creation queries, data insertion queries with visuals, data update and deletion
queries with illustrations, data selection queries with visuals, queries involving multiple data, and a flowchart showcasing its operation.
II. Develop the database system
1. ERD

Figure 1 ERD
2. Mock-up of the application
 Role

Figure 2 Role
 Staff role

Figure 3 Staff Page

Staff members have the right to access their own information. They can view, add, edit, and delete products. They also have the ability
to access customer information and view the data and statistics.
 Customer role

Figure 4 Customer Page

Customers can view their personal information and check their orders.
 Director role

Figure 5 Director Page

The director has the ability to access their own information, information of managers, store sales, and view the data and statistics.
 Customer Homepage

Figure 6 Customer HomePage

Above is the interface that when customers log in to the website, there is a shopping cart in the corner, search engine, As well as being
able to view all products at the store
 Manager Homepage

Below is the interface that when the manager logs in to the website, the toolbar to be able to edit product information, product
categories, edit customer information.

Figure 7 Manager Home page


 Director Homepage

Below is the interface that when the director logs in to the website, the toolbar to be able to edit manager information, store revenue,
Data sheets and product development statistics.

Figure 8 Director Home Page


 Table Customer

A sample customer list table is provided below, it may be updated to add or remove clients.

Figure 9 Edit Customer


 Table Staff

A sample staff list table that may be modified, with staff members added or removed, is shown below.

Figure 10 Edit Staff


 Table Director

A sample director list table that can have manages added, removed, or changed is shown below.

Figure 11 Edit Director


 Table Manager

A sample manage list table that can have manages added, removed, or changed is shown below.

Figure 12 Edit Manager


 Table Products

An editable, addable, and delete able simulated products list table is shown below.

Figure 13 Creat Products


 Add Products

A table with product details to add to the product list is provided below.

Figure 14 Add Products


 Edit Products

To edit products in the list, amend the table below with their details.

Figure 15 Edit Products


 Cart

Below is the cart page, which will display the information of the selected products, the entry price with a checkout button for payment

Figure 16 Cart
CHAPTER 2 – PRODUCES QUERIES:
After creating DB of FPTstore, we will get 1 DB of FPTshop as follows

Figure 17 Project Explorer

Following this is the instruction for table creation. Subsequently, I will generate tables such as Customer, Staff, Manager, Product,
Order, and OrderDetail.
Figure 18 Create Table 1
Figure 19 Create Table 2

For the insert statement in turn the tables I will have the result after inserting the tables as follows.

 Create customers:
Figure 20 Insert customer

 Create Staff:

Figure 21 Insert staff

 Create Manager:
Figure 22 Insert Manager

 Create Products:

Figure 23 Insert Products

 Create Order:
Figure 24 Insert Order

 Create Order Detail:

Figure 25 Insert Order Detail

 Create Director:
Figure 26 Insert Director

 Create Customers Comment:

Figure 27 Insert comments

 Update

The update statement is applied to the Product table's row with ProductID P10 , allowing me to alter the product's name to Washing
Machine, as well as its price and quantity.
Figure 28 Update

 Delete

The delete statement is applied to the Product table's row with ProductID, which is P5, next. When I remove, the outcomes are shown
below.
Figure 29 Delete

 Having

The HAVING statement is applied in the Product table, instead of displaying all the columns and products, I use this command to
filter out a column with the product name and quantity and also assign the condition to only display the products. products with
quantity less than 100

Figure 30 Having
 Between

The BETWEEN statement is applied to the Product table, instead of displaying all the columns and products, I use this command to
filter out 2 columns with the name and price in the range I search, here it is between 50 and 100

Figure 31 Between

 Min

Figure 32 Min

The MIN statement is utilized in the Product table to show the product with the minimum quantity.
 Max

Figure 33 Max

The MAX statement is used in the Product table to showcase the product with the highest quantity.

 Sum

Figure 34 Sum

The SUM statement is employed in the Product table to exhibit the overall quantity of remaining products in the store.

 Avg

Figure 35 Avg
The AVG statement is utilized in the Product table to present the average price of the products sold in the store.

 Join

Finally, I want to query data from customer and customer table, I use Join statement:

Figure 36 Join
CHAPTER 3 – TEST THE SYSTEM:
I. Flow chart

Figure 37 Flowchart
II. User instructions
To access the FPT shop website, you must first choose a role. For customers, click on "Customer" and then press "Sign In" to access.
Upon entering the website, the HomePage will appear, featuring a Role button in the right corner. Clicking on this button allows you to
view your information and the history of purchased and borrowed products.

Additionally, the main page includes a search bar for customers to find specific product types. A navigation bar below offers options to
explore all products, product categories, and new arrivals. The product selection is diverse, providing ample choices for customers.
Underneath product photos, you'll find product names for easy identification. To view product details, click on the respective product
name.

While checking product details, customers can choose the desired quantity and design. The interface is user-friendly. If a customer
wishes to purchase a product, clicking the "Add to Cart" button will automatically add the selected item to the cart.

On the cart page, customers can review selected products, along with their parameters and models. The total number of selected products
and the price of each item are displayed. Customers can choose a payment method and proceed to checkout.

When logging in with the role as "Staff", click on "Staff" and then press "Sign In" to access. After accessing the website, the "Staff"
page will appear, and there will be 4 sections for "Staff" to choose from: "My information", "CRUD information of Product", "Customer
information", "Viewdata".

When logging in as a "Manager", click on "Manager" and then hit "Sign In" to gain access. Upon entering the website, the "Manager
Homepage" will be visible, featuring a toolbar containing four options for the manager to select from. By clicking on the "Category"
button, the manager will be directed to a page where they can view, modify, add, or delete existing categories. Similarly, selecting the
"Products" button will lead to a page displaying comprehensive product information, including images, names, prices, and quantities,
allowing the manager to edit, add, or remove products. Choosing "Customer Information" will present basic details of registered
customers, enabling the manager to add new customers, edit their information, or deactivate customer accounts.

When logging in as a "Director", click on "Director" and then hit "Sign In" to access the platform. Upon entering, the "Director
Homepage" will be displayed, containing a toolbar with options for the "Director" to choose from. Selecting "Store Sales" will bring up
a page showing transaction details, including orders, customer information, and sold product details, all available for the "Director" to
review. Opting for "Manage" will lead to a page displaying information about both staff and managers, where the director can add, edit,
or remove staff and manager entries. Clicking on "Data and Statistics" will provide insights into inventory levels, sales data, and other
relevant information crucial for product development.

III. Test cases


No Descriptions Expected Actual Pass/Fail
Code
Output Output
1 Insert Data to Table Success Success Pass

2 Update Data to Success Success Pass


Table

3 Delete one record Success Success Pass


from Table
4 View all Data from Success Success Pass
table
5 Show the following Success Success Pass
column only
6 Delete all records Success Success Pass
7 Insert Data in Success Success Pass
specific columns

8 Select Data from Success Success Pass


Table
9 Having Data from Success Success Pass
Table

10 Between Data from Success Success Pass


Table
11 Find Min Data from Success Success Pass
Table
12 Find Max Data from Success Success Pass
Table
13 Find Sum Data from Success Success Pass
Table
14 Find Avg Data from Success Success Pass
Table
15 Join Data from Success Success Pass
Table

IV. Conclusion
I have completed all the assigned tasks for this report, which involved creating project mockups, establishing a new database,
generating tables, inputting data into tables, modifying and deleting data, as well as conducting data queries. I have integrated and
represented the user manual and the system test table in a flowchart, following the steps provided in the prior exercise.

Powered by TCPDF (www.tcpdf.org)

You might also like