You are on page 1of 61

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing


Unit 04: Database Design & Development
Unit number and title

Submission date 14/12/2023 Date Received 1st submission


Re-submission Date 14/12/2023 Date Received 2nd submission
Student Name Phung Ba Quoc Anh Student ID BH00610

Class SE06202 Assessor name Nguyen Thai Cuong

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 Anh
Grading grid

P5 P6 P7 P8 M3 M4 D2
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


IV Signature:
Table of Contents
I.Introduction...............................................................................................................................................................................................7
II.Contents...................................................................................................................................................................................................8
P2. Develop the database system with evidence of user interface, output and data validations, and querying across multiple tables......................8
2.1. Final model of the application....................................................................................................................................................................... 8
2.2. Query the database and create tables...........................................................................................................................................................30
2.3 Data validation............................................................................................................................................................................................. 36
P3 Implement a query language into the relational database system......................................................................................................................37
3.1 Query to insert data and final results............................................................................................................................................................37
3.2 The query selects data with a final result image...........................................................................................................................................40
3.3 Query to update data using images...............................................................................................................................................................44
3.4 Query to delete data..................................................................................................................................................................................... 45
P4 Test the system against user and system requirements. = test plan và test cases...............................................................................................46
4.1 Test cases..................................................................................................................................................................................................... 46
P5 Produce technical and user documentation.=hdsd.............................................................................................................................................48
5.1 Technical document..................................................................................................................................................................................... 48
5.1.1 Introduce................................................................................................................................................................................................... 48
5.1.2 User requirements..................................................................................................................................................................................... 48
5.1.3 Diagram.................................................................................................................................................................................................... 49
5.2 User documentation..................................................................................................................................................................................... 50
III.Conclusion............................................................................................................................................................................................60
IV.References............................................................................................................................................................................................61
V.Slide.......................................................................................................................................................Error! Bookmark not defined.
Figure 2 Login form.....................................................................................................................................................................................8
Figure 3 Login with user..............................................................................................................................................................................9
Figure 4 Login with Admin.......................................................................................................................................................................10
Figure 5 Forgot passwords.........................................................................................................................................................................11
Figure 6 Sign up form................................................................................................................................................................................12
Figure 7 Form user - view book................................................................................................................................................................14
Figure 8 Search Book................................................................................................................................................................................15
Figure 9 watch Information.......................................................................................................................................................................16
Figure 10 change information....................................................................................................................................................................17
Figure 11 book management.....................................................................................................................................................................18
Figure 12 Add new books..........................................................................................................................................................................19
Figure 13 Button Fix..................................................................................................................................................................................20
Figure 14 Delete book...............................................................................................................................................................................21
Figure 15 Reader management..................................................................................................................................................................22
Figure 16 add new user..............................................................................................................................................................................23
Figure 17 Delete User................................................................................................................................................................................24
Figure 18 Fix user......................................................................................................................................................................................25
Figure 19 Brrow book................................................................................................................................................................................26
Figure 20 Repayment details.....................................................................................................................................................................27
Figure 21 categoty.....................................................................................................................................................................................28
Figure 22 library card management...........................................................................................................................................................29
Figure 23 Create Database of system........................................................................................................................................................30
Figure 24 create table DocGia...................................................................................................................................................................30
Figure 25 create table NhanVien...............................................................................................................................................................31
Figure 26 Create table Book......................................................................................................................................................................31
Figure 27 Create Table TacGia..................................................................................................................................................................32
Figure 28 Create table TheLoai.................................................................................................................................................................32
Figure 29 Create table NhaXuatBan..........................................................................................................................................................32
Figure 30 Create table TheThuVien..........................................................................................................................................................33
Figure 31 Create Table MuonTra , ChiTietMuonTra................................................................................................................................33
Figure 32 Result of creating tables............................................................................................................................................................34
Figure 33 Database Diagram.....................................................................................................................................................................35
Figure 34 Example of INT data type........................................................................................................................................................36
Figure 35 Example for NVARCHAR data type........................................................................................................................................36
Figure 36 Example for Date data type......................................................................................................................................................36
Figure 37 Insert data for TacGia table.......................................................................................................................................................37
Figure 38 Insert data for TheLoai table.....................................................................................................................................................37
Figure 39 IInsert data for NhaXuatBan table............................................................................................................................................38
Figure 40 Insert data for Sach table...........................................................................................................................................................38
Figure 41 Insert data for DocGia table......................................................................................................................................................38
Figure 42 Insert data for TheThuVien table..............................................................................................................................................39
Figure 43 Insert data for NhanVien table..................................................................................................................................................39
Figure 44 Insert data for ChiTietMuonTra table.......................................................................................................................................39
Figure 45 Select Table...............................................................................................................................................................................40
Figure 46 TacGia table..............................................................................................................................................................................40
Figure 47 DocGia table..............................................................................................................................................................................41
Figure 48 Sach table..................................................................................................................................................................................41
Figure 49 NhanVien table..........................................................................................................................................................................42
Figure 50 MuonTra table...........................................................................................................................................................................42
Figure 51 ChiTietMuonTra table...............................................................................................................................................................42
Figure 52 TheThuVien table......................................................................................................................................................................43
Figure 53 TheLoai table.............................................................................................................................................................................43
Figure 54 Update data...............................................................................................................................................................................44
Figure 55 Before Update:..........................................................................................................................................................................44
Figure 56 After Update..............................................................................................................................................................................44
Figure 57 Delete data from tables..............................................................................................................................................................45
Figure 58 Before Delete:...........................................................................................................................................................................45
Figure 59 After Delete...............................................................................................................................................................................45
Figure 60 ERD of system..........................................................................................................................................................................49
Figure 61 Login documents.......................................................................................................................................................................50
Figure 62 Create account documents.........................................................................................................................................................51
Figure 63 Forgot password documents......................................................................................................................................................52
Figure 64 Reader's book viewing document.............................................................................................................................................53
Figure 65 Watch information document....................................................................................................................................................54
Figure 66 Book management documents..................................................................................................................................................55
Figure 67 Reader management document................................................................................................................................................56
Figure 68 Author management document................................................................................................................................................57
Figure 69 Brrow book management documents........................................................................................................................................58
Figure 70 Return book management documents.......................................................................................................................................59
I.Introduction
After completing ASM1, I, as a Database Developer, opened a new and exciting part of the project with FPT University. This journey
is not only about building a database system but also about the challenges I face and the meaningful tasks I will have to perform.

From now on, the new responsibilities I face go beyond system implementation. I will also have to perform a detailed evaluation of
the system's performance and create detailed documentation and user manuals. The variety and complexity of these requirements
present new challenges, but also opportunities for me to develop and improve my skills.

Deploying a database system is not just about deploying the source code but also requires me to ensure the security and performance
of the system. This includes implementing strict security measures and thorough testing to ensure that the system meets all
requirements.

I also decided to expand the scope of the project by implementing a query language into the database system, opening up the
possibility of dynamically querying and extracting data. This not only increases the diversity of the system, but also creates
opportunities to optimize data management and usage processes.

With the goal of creating a system that not only meets but also exceeds FPT University's expectations, I will continue to evaluate in
detail the performance, usability, and flexibility of the system. At the same time, I will focus on suggesting improvements to make the
system more efficient and flexible.

From testing the system and confirming with managers through witness statements, to creating technical documentation and user
guides, each step requires special attention and persistence. In this way, I will ensure that each aspect of the project is carried out with
the utmost care and quality, while bringing real value to FPT University in its journey.
II.Contents

P2. Develop the database system with evidence of user interface, output and data validations, and querying across multiple
tables.

2.1. Final model of the application

In the first report, I described the library management system in detail in terms of users and features. And in this report, to develop
and perfect the system, I have designed a login interface that integrates the features the system provides. And this is the login
interface of the library management system[1]:

- First is the main interface of the system including Username, Password and buttons and labels such as: Login, forgot password,
create account
Figure 2 Login form

- When a user taps the "Sign In" button, the interface will reflect the type of account they entered, which could be a user account or an
administrative account. Depending on this choice, the system will redirect them to one of two main pages: user page or admin page.

- When the user enters the user account and performs a successful login, the system displays a confirmation message to notify of the
successful login process. This message can be designed to provide welcome and create a positive experience for the user
Figure 3 Login with user

- When the user enters an administrator account and logs in successfully, the system will display a login confirmation message, paying
attention to the account's administrative authority.
Figure 1 Login with Admin

- When a user forgets their password, they will need to tap "Forgot Password" (or "Forgot Password") in the interface, then a new
form will appear where they can recover their password. Here is a description of the process:

When a user becomes aware that they have forgotten their password, they perform the following steps:
Tap "Forgot password": The user will find and tap the button or link that says "Forgot password" on the login interface.

Show Password Recovery Form: After clicking, a new form will appear, asking the user to enter a phone number and account name to
verify identity.

after the user completes the above step. The root password will be displayed in the label box

Figure 2 Forgot passwords

- When users do not have an account, they must click on the create account label. At this point, from create account will be displayed.
After the user enters information into the username, password, name and phone number boxes, they will press the create button to
create an account. After creating an account, they can press the back button to return to the login form
Figure 3 Sign up form

- When the user successfully logs in and enters the user interface, they will be redirected to the Book View Form. Below is a detailed
description of this Form:

Book Viewing Interface: Users will be taken to a friendly interface, displaying a list of book types and search options.
Book lists can be organized by genre, author, or other factors to help users easily choose.

Book Search: The form will provide a search box, allowing users to enter keywords or criteria to quickly search for books.

When users enter keywords, the system will dynamically display appropriate search results.

Figure 4 Form user - view book

- Once the user has completed their search, they can click the "Load" button to return the book table to its original location.
Figure 5 Search Book
- When users click on the "View information" button, they can view and even edit the information by entering the phone number in
the textbox and pressing the "View information" button. After entering the phone number and pressing the button, the text boxes will
display information corresponding to the user.

Figure 6 watch Information


- The account information I registered previously only included some basic information because at that time I did not have an address.
Now, I want to update my address. As for the library card, for some reason I still don't have it. I will contact the library manager for
more details and register later.

Figure 7 change information


- After completing the user interface, we will move on to the admin interface. The first is the book administration interface, where
administrators can perform operations such as viewing the book list, adding, editing, and deleting books. There is also a search and
logout bar that is used similarly to the user form

- This is the interface of book management :

Figure 8 book management


- To add new books, the administrator will fill in all the information in the textboxes. The book code will be unique and only one
value will be allocated.

Figure 9 Add new books


- When a list encounters an error, the administrator can revise the list by entering new information in the text box and then pressing
the "Edit" button . I will change from grade 12 English to grade 12 English. Following is the image for that step

Figure 10 Button Fix


- When that book is no longer available or discontinued. The administrator can click the delete button to delete the book . Following is
the image for that step

Figure 11 Delete book


- The user management form includes a table displaying the user list and is also equipped with a search bar to conveniently find user
information.

Figure 12 Reader management


- To add a new user, the administrator will fill in the information in the text box. The user ID will be unique and only one value will
be allocated.

Figure 13 add new user


- When the user violates or the account is no longer used. Administrators can click the delete button to delete users. Here is the image
for that step. Here I will delete the user whose fake reader code is 593793

Figure 14 Delete User


- Here the user has reader code 14 without a library card, the administrator can revise the list by entering new information in the text
box and then pressing the "Edit" button . I will add 14 library cards for readers

Figure 15 Fix user


- Next is the book borrowing manager. The administrator will press the loan and repayment management button on the menu bar to
display the form. Here, administrators can also add, edit, and delete. Use like other forms. The book loan code will be a required key
when adding a book to borrow.

Figure 16 Brrow book


- Next is the book return management form. The administrator will also click on the book return management button on the menu bar.
Here the buttons and textboxes will be used similarly to other forms and will use the loan and return code in the book loan form. In
condition 1 will be paid and 0 will be unpaid

Figure 17 Repayment details


- After the main forms, there are other sub-forms such as:

- Manage book genres

Figure 18 categoty
- Manage library cards

Figure 19 library card management


2.2. Query the database and create tables
❖ When starting to build the system, the first thing is to create the database.

Figure 20 Create Database of system

❖ Next, we need to create the data tables as shown in the design.

Figure 21 create table DocGia


Figure 22 create table NhanVien

Figure 23 Create table Book


Figure 24 Create Table TacGia

Figure 25 Create table TheLoai

Figure 26 Create table NhaXuatBan


Figure 27 Create table TheThuVien

Figure 28 Create Table MuonTra , ChiTietMuonTra


❖ Foreign and primary keys are generated during table creation. and after creating the table , we get the following result:

Figure 29 Result of creating tables


Figure 30 Database Diagram
2.3 Data validation
❖Datatype:
• INT: It is used for the integer value. Its signed range varies from -2147483648 to 2147483647 and unsigned range varies from 0 to
4294967295. The size parameter specifies the max display width that is 255

Figure 31 Example of INT data type

• NVARCHAR: It is a variable width Unicode string data type. Its size can be up to 4000 characters

Figure 32 Example for NVARCHAR data type

• DATE: It is used to specify date format YYYY-MM-DD. Its supported range is from '1000-01-01' to '9999-12-31'.

Figure 33 Example for Date data type


P3 Implement a query language into the relational database system.

3.1 Query to insert data and final results


❖ After the tables are created, we will insert the initial data information into the tables as follows:

Figure 34 Insert data for TacGia table

Figure 35 Insert data for TheLoai table


Figure 36 IInsert data for NhaXuatBan table

Figure 37 Insert data for Sach table

Figure 38 Insert data for DocGia table


Figure 39 Insert data for TheThuVien table

Figure 40 Insert data for NhanVien table

Figure 41 Insert data for ChiTietMuonTra table


3.2 The query selects data with a final result image
❖ After inserting data into the tables, we can check the information by using the Select

Figure 42 Select Table

❖The information in the tables will appear as follows:

Figure 43 TacGia table


Figure 44 DocGia table

Figure 45 Sach table


Figure 46 NhanVien table

Figure 47 MuonTra table

Figure 48 ChiTietMuonTra table


Figure 49 TheThuVien table

Figure 50 TheLoai table


3.3 Query to update data using images
❖ During the data entry process, if any information is incorrect or needs to be corrected, we can use the Update statement to update
the correct information.

Figure 51 Update data

Before Update:

Figure 52 Before Update:

After Update: Use Select to view data after Update

Figure 53 After Update


3.4 Query to delete data
❖ During the management process, if a reader commits a violation or the library wants to delete it menu item, the system can delete that data
using the Delete command.

Figure 54 Delete data from tables

Before Delete:

Figure 55 Before Delete:

After Delete :

Figure 56 After Delete


P4 Test the system against user and system requirements. = test plan và test cases

4.1 Test cases


❖ In this test, I will use data inserted into P2 to test cases related to the library management system.

Test cases Content Time Expected result

1 Insert data into the tables 1 Success

2 Update data into the tables 1 Success

3 Delete data of the tables 1 Success

4 Select data into the table 1 Success

4.2 Test result

Tetcas Sql code Expectd Test Result Statu


e Result s

1 Orders Pass
The Loai
will
display
the data
inserted
2 Book Pass
productio
n year of
book id =
1 will
change to
2021
3 In the Pass
DocGia
list,
there
won't be
reader
has Id = 7
4 The Pass
system
will
display
the data
table of
the
Items
table
P5 Produce technical and user documentation.

5.1 Technical document

5.1.1 Introduce

❖ Purpose: Developing a database system is the topic of this research. System under this topic is: Design and development of
FPT University's Library management system. From the first step of gathering information to implementing a complete process
if the system meets the needs of the school, development will progress. Prepare data system failure by scheduling upgrades and
maintenance.

❖ Scenario: Currently, with the expansion of the number of students at the University Greenwich Vietnam, the demand for
services such as borrowing textbooks and reading books is gradually increasing. Due to such rapid growth, there are some
difficulties in managing the university library system. So this project was created to make library management easier and more
efficient.[2]

5.1.2 User requirements

❖ This section was developed with the goal of describing the product features that the database system can display to the user.
All the following features will be present in a fully built Library Management System:

• Manage reader information: All reader information must have a unique code

DocGia to locate those readers throughout the database. Readers must have full name, phone number and address.

• Book information management: All book information must have a unique Items_ID to

locate those Items throughout the database. Items must have their category, Item's

• Management of loan and return information: All information about loan and return of books must be filled out completely and
accurately. Management supports looking into that

information when encountering errors or omissions during library operations


5.1.3 Diagram

Figure 57 ERD of system


5.2 User documentation
❖ Login window:

Figure 58 Login documents

• 1: Enter the account name of the reader or administrator

• 2: Enter the Password of the reader or administrator

• 3: Login

• 4: Go to the reader account creation page

• 5: Go to the forgot password page

• 6: Exit the application


❖ Account creation window :

Figure 59 Create account documents

• 1: Enter the account name of the reader

• 2: Enter the Password of the reader

• 3: Enter name

• 4: Enter phone number

• 5: Create account

• 6: Return to the login window

• 6: Exit the application


❖ Password recovery window

Figure 60 Forgot password documents

• 1: Enter the account name

• 2: Enter phone number

• 3: Forgot

• 4: The old password will be displayed here

• 5: Return to the login window

• 6: Exit the application


❖ Reader's book viewing window

Figure 61 Reader's book viewing document

• 1: Current window

• 2: Information viewing window

• 3: Return to the login window

• 4: Exit the application

• 5: The screen displays books

• 6: Enter text to search for books

• 7: Click to search for books

• 8: Click to reload the book screen


❖ Watch information window

❖ Watch information window

Figure 62 Watch information document

• 1: Enter phone number to view information

• 2: The name will be displayed in this box

• 3: Address will be displayed in this box

• 4: Library will be displayed in this box

• 5: Username will be displayed in this box

• 6: Password text to search for books

• 7: Code reader to search for books

• 8: Click to view information


• 9: Click to update information

❖ Book management window

Figure 63 Book management documents

• 1: Book management • 8: Click to add books (must have book code)

• 2: Enter book code • 9: Click to fix books (must have book code)

• 3: Enter book name • 10: Click to delete books (must have book code)

• 4: Enter author code • 11: Click to delete all text in the cells

• 5: Enter category code • 12: Enter text to search

• 6: Enter publisher code • 13: Enter button to search

• 7: Enter publishing year •14 : Click to reload the book screen


❖ Reader management window

Figure 64 Reader management document

• 1: Book management • 8: Click to add books (must have book code)

• 2: Enter book code • 9: Click to fix books (must have book code)

• 3: Enter book name • 10: Click to delete books (must have book code)

• 4: Enter author code • 11: Click to delete all text in the cells

• 5: Enter category code • 12: Enter text to search

• 6: Enter publisher code • 13: Enter button to search


• 7: Enter publishing year •14 : Click to reload the book screen

❖ Author management window

Figure 65 Author management document

• 1: Author management • 8: Enter text to search

• 2: Enter author code • 9: Enter button to search

• 3: Enter author name • 10: Click to reload the book screen

• 4: Click to add author (must have author code)

• 5: Click to fix author (must have author code)

• 6: Click to author books (must have author code)

• 7: Click to delete all text in the cells


❖ Brrow book management window

Figure 66 Brrow book management documents

• 1: Brrow book management • 7: Click to fix Brrow book

• 2: Enter Borrowing code • 8: Click to delete all text in the cells

• 3: Enter library code • 9: Click to delete all text in the cells

• 4: Enter admin code • 10: Enter text to search

• 5: Enter Brrow day • 11: Enter button to search

• 6: Click to add Brrow book • 12: Click to reload the book screen
❖ Return book management window

Figure 67 Return book management documents

• 1: Return book management • 7: Click to add return book

• 2: Enter Borrowing code • 8: Click to fix return book

• 3: Enter book code • 9: Click to delete return book

• 4: Enter note • 10: Click to delete all text in the cells

• 5: Enter cindition

• 6:Enter Results day


III.Conclusion
In conclusion, embarking on the ASM2 project at FPT University has not only marked the initiation of a new and exciting phase in my
role as a Database Developer but has also evolved into a multifaceted journey filled with challenges and significant responsibilities.
The transition from mere system implementation to a comprehensive role involving performance evaluation, meticulous
documentation, and user manual creation has broadened the scope of my responsibilities.

As I navigate through the intricacies of ensuring the security and optimal performance of the deployed database system, I am
confronted with new challenges that, in turn, provide valuable opportunities for the enhancement of my skills. The commitment to
implementing stringent security measures and conducting thorough testing underscores the dedication to meeting all system
requirements and ensuring its reliability.

Moreover, the decision to expand the project's scope by integrating a query language into the database system not only diversifies its
functionalities but also introduces avenues for optimizing data management processes. This strategic move aims not just to meet but to
exceed FPT University's expectations, emphasizing a commitment to creating a system that is not only efficient but also flexible.

As I continue to scrutinize the system's performance, usability, and flexibility, my focus remains on suggesting improvements that
contribute to its efficiency and adaptability. Each step, from rigorous testing to the creation of technical documentation and user
guides, demands meticulous attention and unwavering persistence. By adhering to these principles, I am poised to ensure that every
facet of the project is executed with the utmost care and quality, ultimately delivering tangible value to FPT University in its ongoing
journey.
IV.References
1. Kien, N. (n.d.). Phân tích thiết kế - Quản lý thư viện. www.academia.edu. [online] Available at:
https://www.academia.edu/39698841/Ph%C3%A2n_t%C3%ADch_thi%E1%BA%BFt_k%E1%BA%BF_Qu%E1%BA%A3n_l
%C3%BD_th%C6%B0_vi%E1%BB%87n [Accessed 5 Dec. 2023].

2. doc.edu.vn. (n.d.). Phân tích cơ sở dữ liệu cho hệ thống quản lý thư viện - Tài liệu, ebook, giáo trình. [online] Available at:
https://doc.edu.vn/tai-lieu/phan-tich-co-so-du-lieu-cho-he-thong-quan-ly-thu-vien-86908/ [Accessed 5 Dec. 2023].

Link slide : https://www.canva.com/design/DAFwHD-bTPc/neQTTE0DKTxshWcTcrWidA/edit?utm_content=DAFwHD-


bTPc&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Link the application and sql : https://drive.google.com/file/d/1XyqCZFxgSZPXnPfmb-rOlZYTp6tTINkw/view?usp=sharing

You might also like