Higher Nationals in Computing
Database Design and
Development
ASSIGNMENT
No.2
Learner’s name: PHAM NGUYEN QUYNH NHU
Assessor name: NGUYEN VAN SON
Class: ...............GCS1005A.................…
Learner’s ID: .............GCS210018...............
Subject’s ID: .................1622................
Assignment due:
Assignment submitted:
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
Pham Nguyen Quynh Nhu
Student ID
GCS210018
Class
GCS1005A
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.
Nhu
Student’s signature
Grading grid
P2
P3
P4
P5
M2
M3
M4
M5
D2
D3
❒ Summative Feedback:
Grade:
Signature & Date:
❒ Resubmission Feedback:
Assessor Signature:
Date:
Assignment Brief 2 (RQF)
Higher National Certificate/Diploma in Computing
Student Name/ID Number:
Pham Nguyen Quynh Nhu (GCS210018)
Unit Number and Title:
Unit 04: Database Design & Development
Academic Year:
2022
Unit Assessor:
Nguyen Van Son
Assignment Title:
Database implementation and Testing
Issue Date:
23 Oct. 22
Submission Date:
Internal Verifier Name:
Date:
Submission Format:
Format:
This assignment is an Individual assignment and specifically including 2 documents:
(1) sql file of your code and represent your code to your tutor
(2) a report document
You must use font Calibri size 12, set number of the pages and use multiple line spacing at 1.3. Margins
must be: left: 1.25 cm; right: 1 cm; top: 1 cm and bottom: 1 cm. The reference follows Harvard referencing
system. The recommended word limit is 2.000-2.500 words. You will not be penalized for exceeding the
total word limit. The cover page of the report has to be the Assignment front sheet 2.
Submission
Students are compulsory to submit the assignment in due date and in a way requested by the Tutor.
The form of submission will be a soft copy posted on />
Remember to convert the word file into PDF file before the submission on CMS.
Note:
The individual Assignment must be your own work, and not copied by or from another student.
If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must
reference your sources, using the Harvard style.
Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to comply this
requirement will result in a failed assignment.
Unit Learning Outcomes:
3|Page
LO2 Develop a fully functional relational database system, based on an existing system design.
LO3 Test the system against user and system requirements.
LO4 Produce technical and user documentation
Assignment Brief and Guidance:
Assignment scenario
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 2 (Assignment 2)
Once the designs have been accepted by your manager you have been asked to:
Develop the database system using evidence of user interface, output and data validations and querying across
multiple tables.
You want to include more than just the basics so you will implement a fully functional database system which
will include system security and database maintenance features.
You have decided to implement a query language into the relational database system. The developed system will
be demonstrated to your manager.
Your manager has asked you to include in the report:
(1) Assessing whether meaningful data has been extracted through the use of query tools to produce appropriate
management information.
(2) Evaluating the effectiveness of the database solution in relation to user and system requirements, and suggest
improvements.
(3) Once the system has been developed, you will test the system and your manager will complete a witness
statement indicating how your tests are performing against user and system requirements.
(4) You will produce a brief report assessing the effectiveness of the testing, including an explanation of the
choice of test data used.
(5) Lastly you will produce technical and user documentation which will be given to the company.
You want to provide some graphical representations for ease of reference in the technical guide, so you have
decided to produce a technical and user documentation for a fully functional system, including diagrams showing
movement of data through the system, and flowcharts describing how the system works.
4|Page
Learning Outcomes and Assessment Criteria (Assignment 2):
Learning Outcome
Pass
Merit
Distinction
LO2
P2 Develop the database
system with evidence of
user interface, output
and data validations, and
querying across multiple
tables.
M2 Implement a fully
functional database
system which includes
system security and
database maintenance.
D2 Evaluate the
effectiveness of the
database solution in
relation to user and
system requirements,
and suggest
improvements.
P3 Implement a query
language into the
relational database
system.
LO3
P4 Test the system
against user and system
requirements.
LO4
P5 Produce technical
and user documentation.
M3 Assess whether
meaningful data has
been extracted through
the use of query tools to
produce appropriate
management
information.
M4 Assess the
effectiveness of the
testing, including an
explanation of the
choice of test data used.
M5 Produce technical
and user documentation
for a fully functional
system, including ER
Diagram and
normalization
statements and
describing how the
system works.
D3 Assess any future
improvements that may
be required to ensure the
continued effectiveness
of the database system.
5|Page
Content
Introduce ......................................................................................................................................................16
I - Develop the database system .................................................................................................................... 9
1.1 Final Mock-up of the application .....................................................................................................9
1.2 Queries to create database with results .......................................................................................... 12
A - Table design of Login .............................................................................................................12
B - Table design of Staff ...............................................................................................................13
C - Table design of Customer ....................................................................................................... 13
D - Table design of Bill ................................................................................................................ 14
E - Table design of Bill’s detail .................................................................................................... 14
F - Table design of Product ...........................................................................................................15
G - Table design of Rate ............................................................................................................... 15
II – Produce queries .....................................................................................................................................16
2.1 Queries to INSERT data with illustrations of final result .............................................................. 16
A - Insert into table Login .............................................................................................................16
B - Insert into table Staff ...............................................................................................................17
C - Insert into table Customer .......................................................................................................18
D - Insert into table Bill ................................................................................................................ 19
E - Insert into table Bill’s detail ....................................................................................................20
F - Insert into table Product .......................................................................................................... 22
G - Insert into table Rate ...............................................................................................................23
2.2 Queries to UPDATE data with illustrations of final result ............................................................ 24
2.3 Queries to DELETE data with illustrations of final result .............................................................26
2.4 Queries to SELECT data with illustrations of final result ............................................................. 28
2.5 Advanced queries: Stored procedures, triggers, functions .............................................................34
A - Stored procedures. .................................................................................................................. 34
B - Triggers in SQL ...................................................................................................................... 35
C - Function .................................................................................................................................. 36
2.6 Evaluate the effectiveness of the database solution ....................................................................... 38
III – Test the system .................................................................................................................................... 38
3.1 Test cases ....................................................................................................................................... 38
6|Page
Content of figure
Figure 1 : The login screen .....................................................................................................................9
Figure 2 : Primary interface ................................................................................................................... 9
Figure 3 : Profile’s staff ....................................................................................................................... 10
Figure 4 : Details of the customer ........................................................................................................ 10
Figure 5 : Details of Bill .......................................................................................................................11
Figure 6 : Information of Bill's details ................................................................................................. 11
Figure 7 : Product descriptions ............................................................................................................ 12
Figure 8 : Information of Rate ............................................................................................................. 12
Figure 9 : Login panel design ...............................................................................................................13
Figure 10 : Staff panel design .............................................................................................................. 13
Figure 11 : Customer panel design .......................................................................................................14
Figure 12 : Bill panel design ................................................................................................................ 14
Figure 13 : Bill’s detail panel design ................................................................................................... 15
Figure 14 : Product panel design ..........................................................................................................15
Figure 15 : Rate panel design ...............................................................................................................16
Figure 16 : Source code to insert to the table Login. ........................................................................... 17
Figure 17 : Add successful data to the table Login. .............................................................................17
Figure 18 : Source code to insert to the table Staff. ............................................................................. 18
Figure 19 : Add successful data to the table Staff ................................................................................18
Figure 20 : Source code to insert to the table Customer. ..................................................................... 19
Figure 21 : Add successful data to the table Customer. .......................................................................19
Figure 22 : Source code to insert to the table Bill. ...............................................................................20
Figure 23 : Add successful data to the table Bill. ................................................................................ 20
Figure 24 : Source code to insert the table BillDetail. ......................................................................... 21
Figure 25 : Add successful data to the table BillDetail ........................................................................21
Figure 26 : Source code to insert the information to the table Product. ..............................................22
Figure 27 : Add successful data to the table Product. .......................................................................... 22
Figure 28 : Source code to insert the information on the table Rate. ...................................................23
Figure 29 : Add successful information on the table Rate. .................................................................. 24
Figure 30 : Product table after the number of products has been updated. ..........................................25
7|Page
Figure 31 : Customer table after the number of products has been updated. .......................................26
Figure 32 : Bill table after the number of products has been updated. ................................................ 26
Figure 33 : Login table after the number of products has been deleted. ..............................................27
Figure 34 : Product table after the number of products has been deleted. ........................................... 28
Figure 35 : Select products with a price of less than 10,000,000 .........................................................29
Figure 36 : Select 50 percent of Staff ...................................................................................................30
Figure 37 : Select Staff's ID with the number 05, 06, 07 from the Login table ................................... 31
Figure 38 : Select the product's ID and name of the product costing from 15,000,000 to 30,000,00. .32
Figure 39 : Count the total bill ............................................................................................................. 32
Figure 40 : The average price of the product costs from 1,000,000 to 10,000,000 ............................. 33
Figure 41 : Select top 1 and top 2 Price of Product ............................................................................. 33
Figure 42 : Calculate the total product value and are about to increase in order. ................................34
Figure 43 : The syntax for generating Stored procedure ......................................................................35
Figure 44 : The syntax for generating Trigger. .................................................................................... 36
Figure 45 : The syntax for generating Function. ..................................................................................37
Figure 46 : Discount function of the product. ...................................................................................... 38
8|Page
I - Develop the database system
1.1 Final Mock-up of the application
A comprehensive blueprint of the system was created based on the existing mock-up designs from the
prior job. This update adds additional statistics querying capabilities for library administration.
Figure 1: The login screen
Figure 2: Primary interface
9|Page
Figure 3: Profile’s staff
Figure 4: Details of the customer
10 | P a g e
Figure 5: Details of Bill
Figure 6: Information of Bill's details
11 | P a g e
Figure 7: Product descriptions
Figure 8: Information of Rate
1.2 Queries to create database with results
A - Table design of Login
12 | P a g e
Figure 9: Login panel design
B - Table design of Staff
Figure 10: Staff panel design
C - Table design of Customer
13 | P a g e
Figure 11: Customer panel design
D - Table design of Bill
Figure 12: Bill panel design
E - Table design of Bill’s detail
14 | P a g e
Figure 13: Bill’s detail panel design
F - Table design of Product
Figure 14: Product panel design
G - Table design of Rate
15 | P a g e
Figure 15: Rate panel design
ASSIGNMENT 2
Introduce
In this project, an FPT shop system database was implemented on SQL server using query language. This
database enables for the modification, deletion, and insertion of important information to manage the
shop, such as customer personal information, staff information, login, product information, bill
information, bill's detail information, and rate. It is also equipped with data to assist administrators in
managing and monitoring the library's status. A comprehensive mock-up, as well as a relational database,
has been developed and exhibited here. Bugs are also fixed by testing. Finally, a technical manual based
on the mock-up was created to help users in utilizing the system.
II – Produce queries
2.1 Queries to INSERT data with illustrations of final result
A - Insert into table Login
16 | P a g e
Figure 16: Source code to insert to the table Login.
Figure 17: Add successful data to the table Login.
B - Insert into table Staff
17 | P a g e
Figure 18: Source code to insert to the table Staff.
Figure 19: Add successful data to the table Staff
C - Insert into table Customer
18 | P a g e
Figure 20: Source code to insert to the table Customer.
Figure 21: Add successful data to the table Customer.
D - Insert into table Bill
19 | P a g e
Figure 22: Source code to insert to the table Bill.
Figure 23: Add successful data to the table Bill.
E - Insert into table Bill’s detail
20 | P a g e
Figure 24: Source code to insert the table BillDetail.
Figure 25: Add successful data to the table BillDetail
21 | P a g e
F - Insert into table Product
Figure 26: Source code to insert the information to the table Product.
Figure 27: Add successful data to the table Product.
22 | P a g e
G - Insert into table Rate
Figure 28: Source code to insert the information on the table Rate.
23 | P a g e
Figure 29: Add successful information on the table Rate.
2.2 Queries to UPDATE data with illustrations of final result
I attempted to update the data in various database tables to see if the update function worked. Users can
update data with the syntax “UPDATE table_name SET column1 = value1, column2 = value2,…WHERE
condition”. The following are the results of my testing using three database tables.
24 | P a g e