You are on page 1of 46

ASSIGNMENT 1 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 Trần Thanh Tùng Student ID BHAF190148

Class BH-AF2005-2.2-DDD Assessor name Ngô Thị Mai Loan

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

1
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:

2
3
Contents
I. INTRODUCTION.................................................................................................................................6
II. SYSTEM REQUIREMENTS...........................................................................................................7
1. Real world scenario.............................................................................................................................7
2. Data requirements for storage..............................................................................................................7
3. Relationship between entities..............................................................................................................8
III. DATABASE DESIGN.......................................................................................................................8
1. ER Diagram.........................................................................................................................................8
2. Convert ER Diagram to Relation Diagram..........................................................................................9
3. Normalization....................................................................................................................................10
4. Relational database system................................................................................................................11
5. Implement a query language..............................................................................................................13
IV. DATABASE DEVELOPMENT.....................................................................................................13
1. Application design.............................................................................................................................13
2. Application Code...............................................................................................................................20
V. TESTCASE AND TEST LOG...........................................................................................................24
1. Test Form Login................................................................................................................................24
2. Test Form Sign Up.............................................................................................................................25
3. Test Form Library..............................................................................................................................25
4. Test Form Book.................................................................................................................................26
5. Test Form Publisher...........................................................................................................................27
6. Test Form Customer..........................................................................................................................28
7. Test Form Bill....................................................................................................................................29
VI. TECHNICAL USER DOCUMENTATION..................................................................................31
1. How to login and sign up account.....................................................................................................31
2. How to use the program's functions...................................................................................................32
VII. CONCLUSION................................................................................................................................46
VIII. REFERENCE LIST.....................................................................................................................47

4
I. INTRODUCTION
In this exercise, I will write a program to manage books for a university library. Every book has
Information such as <id, name, ...> each book will be identified by an ID
to determine which library the book belongs to. Each author also has information such as <name,
phone
numbers, addresses, ...> and each author has an ID to identify which author of which book.

5
II. SYSTEM REQUIREMENTS

1. Real world scenario


I am working as a database developer for a large IT consulting company. The company has
been. Access by FPT University is expanding due to the growth in the number of students. FPT
is currently having difficulty managing university students. The construction of library
management. The system is implemented with the following components: Library, books,
authors, publishers, customers and invoices. There are many different libraries at FPT, so we
can distinguish the library by its properties. Field properties include: LibararyID,
LibararyName, LibararyAdress.

2. Data requirements for storage

Description
Entity Attribute Description of Attribute
of Entity
It is a unique identifier for each book in the
BookID
library

All of BookName Name of Book


Book books in
library BookPublisher Publishers of book

LibraryID It is a unique identifier


Library of
Library all LibraryName Name of Library
books
LibraryAddress Address of Library

PublisherID It is a unique identifier


Publisher of
Publisher
book
PublisherName Name of Publisher

CardID It is a unique identifier


People
FullName Name of People

6
Address Address of people

Phone Phone of People

BillID It is a unique identifier for people

Bill Borrowdate Borrow date of People

ReturnDate Return Date of People

3. Relationship between entities


- Relationship between entities: Libraries and books
A library may have many books, but each book belongs to only one library
- Relationship between entities: Library and people
A library can have many people, but each person belongs to only 1 library
- Relationship between entities: Library and publisher
A library can have many publishers but each publisher belongs to only one library
- Relationship between entities: Bill and book
A person may have many bill but each bill belongs only one person
- Relationship between entities: Bill and people
A person may have many bill but each bill belongs only one person

III. DATABASE DESIGN


1. ER Diagram
a. Define
- ERD is a diagram, showing the entities in the database, and the relationship between them.
b. Uses
- Help with system analysis: In maintenance projects, reading the ERD of the current system
is an effective way for us to get an overview of the objects and their functions.
- Help debug database: In complex systems, cluttered structures, or containing hundreds of
tables, visualizing the tables into images will help us easily detect irrelevant points, "shady"
and "redundant" relationships. redundant "between tables.
- Help design report
- Help visualize the overview of the system: Approaching top-down direction, ERD will help
us list the objects included in the system.
c. Example

7
Figure 3.1 Example illustration for ER

2. Convert ER Diagram to Relation Diagram

8
Figure 3.2 Convert ER Diagram to Relation Diagram

3. Normalization
a. Define
(microsoft. 2020)
Normalization is the process of organizing data in a database. This includes creating tables
and establishing relationships between those tables according to rules designed both to
protect the data and to make the database more flexible by eliminating redundancy and
inconsistent dependency.
b. Purpose
(microsoft. 2020)
- Eliminate repeating groups in individual tables.
- Create a separate table for each set of related data.
- Identify each set of related data with a primary key.
- Create separate tables for sets of values that apply to multiple records.
- Relate these tables with a foreign key.

9
- Eliminate fields that do not depend on the key.

4. Relational database system


- To create the new database diagram, you will need to right click on Database Diagrams
folder and click on New Database Diagram

Figure 3.3 Create the new database diagram


- If you create diagram for the first time you may get the following message

Figure 3.4 Message


- window will appear with list of all the tables in your database. To add the tables to the
diagram select them (use Control or Shift keys to select multiple at once) and click Add
button or double click on them. When you add all required tables click Close button

10
Figure 3.5 Add table
- After adding all the tables, we have an ER diagram with Microsoft SQL Server
Management Studio

Figure 3.6 Relation Diagram

11
5. Implement a query language
- Statement adds data to the table

Figure 3.7 insert data


- Query all rows and columns with key SELECT * FROM ( Table Name)

Figure 3.8 View table


IV. DATABASE DEVELOPMENT
1. Application design
a. Form login design

12
Figure 4.1 System interface login
b. Form Sign up design

13
Figure 4.2 System interface sign up

c. Form Library design

14
Figure 4.3 System library interface

d. From Book design

15
Figure 4.4 System Book interface

e. Form Publisher design

16
Figure 4.5 System publisher interface

f. Form Customer design

17
Figure 4.6 System customer interface
g. Form Bill design

18
Figure 4.7 System bill interface

2. Application Code
a. Code Login

19
Figure 4.8 Code Login
b. Code Sign up

Figure 4.9 Code Sign up

20
c. Code ADD

Figure 4.10 Code ADD


d. Code Update

Figure 4.11 Code Update


e. Code Delete

21
Figure 4.12 Code Delete
f. Code Search

Figure 4.13 Code Search


g. Code Back

22
Figure 4.14 Code Back
h. Code Exit

Figure 4.15 code Exit


i. Code Clear

Figure 4.16 Code Clear

V. TESTCASE AND TEST LOG


1. Test Form Login

23
Test Actua
2. Action
Test How Data Expected results Date l
taken
Use results
Enter Username Correct both
and Password into Username and
Data in
textBox and click Password is login
1. textbo 15/8/2020 Ok None
Login successful.
x
Otherwise, login
fails
Test Form Sign Up

3. Test
Actual Action
Test How Data Expected results Date
results taken
Use
If the Username is
not duplicated with
the existing
account, the
Password is not
Enter and select the
empty, the
information into
Data in information is
1. the corresponding 15/8/2020 Failed Retest
textbox entered in the
textBox, and click
correct data type,
Sign Up
then create a new
account
successfully.
Otherwise, account
creation failed
If the Username is
not duplicated with
the existing
account, the
Password is not
Enter and select the
empty, the
information into
Data in information is
2. the corresponding 15/8/2020 OK None
textbox entered in the
textBox, and click
correct data type,
Sign Up
then create a new
account
successfully.
Otherwise, account
creation failed
Test Form Library

24
Test
Actual Action
Test How Data Expected results Date
results taken
Use
Data entry order is
Enter data from the same as that on
data capture sheet Data the data capture
1. 15/8/2020 OK None
into the form on the Set sheet
data entry screen

If the information is
entered in the
correct data type,
Library ID is not
Enter data into the repeated with
Data
2. textboxes on the existing Library 15/8/2020 OK None
Set
form and click Add ID, then the
addition is
successful.
Otherwise, addition
is failed
If the information is
entered in the
correct data type,
Enter data into the Library ID already
textboxes on the Data exists in the list
3. 15/8/2020 OK None
form and click Set table, information
Update is changed
successfully.
Otherwise, Update
is failed
If library ID exists
Enter Library ID in the list table,
Data delete is successful.
4. into the textbox and 15/8/2020 OK None
Set Otherwise, Delete
click Delete
is failed
Displays a list of
Enter the Library
Library with names
Name into search
Data that match or
5. in the textbox of 15/8/2020 OK None
Set partially match with
the search section
the keyword
and click Search
searched

4. Test Form Book

25
Test
Actual Action
Test How Data Expected results Date
results taken
Use
Data entry order is
Enter data from the same as that on
data capture sheet Data the data capture
1. 15/8/2020 OK None
into the form on the Set sheet
data entry screen

If the information is
entered in the
correct data type,
Book ID is not
Enter data into the
Data duplicated with the
2. textboxes on the 15/8/2020 OK None
Set existing Book ID,
form and click Add
the addition is
successful. If not,
the addition is
unsuccessful
If the information is
entered in the
correct data type,
Enter data into the Book ID already
textboxes on the Data exists in the list
3. 15/8/2020 OK None
form and click Set table, information
Update is changed
successfully.
Otherwise, Update
is failed
If Book ID exists in
Enter Book ID into the list table, delete
Data is successful.
4. the textbox and 15/8/2020 OK None
Set Otherwise, Delete
click Delete
is failed
Displays a list of
Enter the Book
Book with names
Name into search
Data that match or
5. in the textbox of 15/8/2020 OK None
Set partially match with
the search section
the keyword
and click Search
searched

5. Test Form Publisher

26
Test
Actual Action
Test How Data Expected results Date
results taken
Use
Data entry order is
Enter data from the same as that on
data capture sheet Data the data capture
1. 15/8/2020 OK None
into the form on the Set sheet
data entry screen

If the information is
entered in the
correct data type,
Publisher ID is not
Enter data into the repeated with
Data
2. textboxes on the existing Publisher 15/8/2020 OK None
Set
form and click Add ID, then the
addition is
successful.
Otherwise, addition
is failed
If the information is
entered in the
correct data type,
Publisher ID
Enter data into the
already exists in the
textboxes on the Data
3. list table, 15/8/2020 OK None
form and click Set
information is
Update
changed
successfully.
Otherwise, Update
is failed
If Publisher ID
exists in the list
Enter Publisher ID
Data table, delete is
4. into the textbox and 15/8/2020 OK None
Set successful.
click Delete
Otherwise, Delete
is failed
Displays a list of
Enter the Publisher
Publisher with
Name into search
Data names that match
5. in the textbox of 15/8/2020 OK None
Set or partially match
the search section
with the keyword
and click Search
searched

6. Test Form Customer

27
Test
Actual Action
How Data Expected results Date
results taken
Use
Data entry order is
Enter data from the same as that on
data capture sheet Data the data capture
1. 15/8/2020 OK None
into the form on the Set sheet
data entry screen

If the information is
entered in the
correct data type,
ID is not repeated
Enter data into the
Data with existing
2. textboxes on the 15/8/2020 OK None
Set Publisher ID, then
form and click Add
the addition is
successful.
Otherwise, addition
is failed
If the information is
entered in the
correct data type,
Enter data into the ID already exists in
textboxes on the Data the list table,
3. 15/8/2020 OK None
form and click Set information is
Update changed
successfully.
Otherwise, Update
is failed
If ID exists in the
Enter ID into the list table, delete is
Data successful.
4. textbox and click 15/8/2020 OK None
Set Otherwise, Delete
Delete
is failed
Displays a list of
Enter the Customer
Customer with
Name into search
Data names that match
5. in the textbox of 15/8/2020 OK None
Set or partially match
the search section
with the keyword
and click Search
searched

7. Test Form Bill

28
Test
Actual Action
How Data Expected results Date
results taken
Use
Data entry order is
Enter data from the same as that on
data capture sheet Data the data capture
1. 15/8/2020 OK None
into the form on the Set sheet
data entry screen

If the information is
entered in the
correct data type,
Bill ID is not
Enter data into the repeated with
Data
2. textboxes on the existing Publisher 15/8/2020 OK None
Set
form and click Add Bill ID, then the
addition is
successful.
Otherwise, addition
is failed
If the information is
entered in the
correct data type,
Enter data into the Bill ID already
textboxes on the Data exists in the list
3. 15/8/2020 OK None
form and click Set table, information
Update is changed
successfully.
Otherwise, Update
is failed
If Bill ID exists in
Enter Bill ID into the list table, delete
Data is successful.
4. the textbox and 15/8/2020 OK None
Set Otherwise, Delete
click Delete
is failed
Displays a list of
Enter the Bill
Bill with names
Name into search
Data that match or
5. in the textbox of 15/8/2020 OK None
Set partially match with
the search section
the keyword
and click Search
searched

VI. TECHNICAL USER DOCUMENTATION


1. How to login and sign up account

29
- If you already have an account or fill out the username and password in the corresponding
boxes as below, then please click login to log into the program.

Figure 6.1 login


- If you do not have an account, please click on create an account as shown below

30
Figure 6.2 login
- After clicking on it will appear the registration interface as shown below. Then please fill
out the information to create an account, then click sign up.

Figure 6.3 Sign Up


2. How to use the program's functions
- ADD click:
 You fill in the boxes as shown below and then click the add button. Note that you will
not be able to enter the same IDs as the existing IDs

31
Figure 6.4 How to use add button
 After clicking the add button the data will be added to the table as shown below

32
Figure 6.5 How to use add button

- Update click:
 If you want to edit the information in the table, first click on the data you want to edit it
will appear in the information box. Ok now you can edit it done then press the update
button to finish

33
Figure 6.6 How to use update button

 After clicking the update button the data will be added to the table as shown below

34
Figure 6.7 How to use update button

- Delete click
 If you want to delete information in the table, firstly click on the data you want to
delete it will appear in the information box. Ok now you can finish deleting and press
the delete button to finish

35
Figure 6.8 How to use delete button

 After clicking the delete button, the data will be deleted as shown below

36
Figure 6.9 How to use delete button

- Back Click:
 If you want to return to the login interface please click the back button as shown below

Figure 6.10 How to use Back button

- Exit click:
 If you want exit please click the exit button as shown below

Figure 6.11 How to use exit button

37
- Clear click:
 If you want to clear information in the table information, please click the Clear button
as shown below

Figure 6.12 How to use clear button

 After clicking the clear button, the information will be clear as shown below

38
Figure 6.13 How to use clear button

- Other information click


 Other functions Please kick on as shown below

39
Figure 6.13 How to use other button

 After clicking on the above functions it will display information of the corresponding
tables for your selection. note the function buttons are the equivalent of the library
buttons so I won't say it again!

40
Figure 6.14 book library

41
Figure 6.15 Publisher

42
Figure 6.14 Customer

43
Figure 6.14 bill

- And those are all program manuals.

44
VII. CONCLUSION
In summary, in this exercise, I finished writing a library management program for a university
and insert data into tables, design an interface for the program.

45
VIII. REFERENCE LIST
Thinhnotes. 2020. ERD La Gi? | Thinhnotes.Com. [online] Available at:
<https://thinhnotes.com/chuyen-nghe-ba/erd-la-gi/> [Accessed 28 July 2020].microsoft.
2020. Database Normalization Description - Office. [online] Available at:
<https://docs.microsoft.com/en-us/office/troubleshoot/access/database-normalization-
description#:~:text=Normalization%20is%20the%20process%20of,eliminating%20redundancy
%20and%20inconsistent%20dependency.> [Accessed 28 July 2020].

46

You might also like