You are on page 1of 31

Higher Nationals in Computing

Unit 2: Website Designe and Development

Learner’s name: DANG AN THANH


ID: GCS190644
Class: GCS0805_PPT
Subject code: 1622
Assessor name: NGUYEN VAN SON

Assignment due: 6 / 1 1 / 2 0 2 0 Assignment submitted: 3 0 / 1 0 / 2 0 2 0


ASSIGNMENT 2 FRONT SHEET

Qualification TEC Level 5 HND Diploma in Computing

Unit number and title Unit 04: Database Design & Development

Submission date 30/10/2020 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Dang An Thanh Student ID GCS190644

Class GCS0805_PPT Assessor name Nguyen Van Son

Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature

Grading grid

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

Grade: Assessor Signature: Date:

Signature & Date:


ASSIGNMENT 2 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing

Unit number Unit 04: Database Design & Development

Assignment title

Academic Year 2020-2021

Unit Tutor

Issue date Submission date 30/10/2020

IV name and 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 mananger (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 Tutors. The form of submission will be a soft copy posted on
http://cms.greenwich.edu.vn/
Note: The Assignment must be your own work, and not copied by or from another student or from
books etc. 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 know how to reference
properly, and that understand the guidelines on plagiarism. If you do not, you definitely get fail

Unit Learning Outcomes:


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:

You are employed as a Database Developer for a large IT consultancy company. The company has been
approached by FPT university which is expanding due to the growth of the number of students. FPT is
currently facing difficulties in dealing with managing the university. It decided to develop several
academic systems to manage the university easier including: Online Library system, Student Grading
System, Attendance System, CMS System, Scheduling System, Enrolment Systems, and so on.
You are tasked to select one of those systems to develop database for FPT university. Your tasks are to:
Work with FPT to find out about current requirements for each system
Analyze 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:
1. 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:
2. Assessing whether meaningful data has been extracted through the use of query tools to produce
appropriate management information.
3. Evaluating the effectiveness of the database solution in relation to user and system requirements,
and suggest improvements.
4. 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.
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.

Learning Outcomes and Assessment Criteria

Pass Merit Distinction


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
P2 Develop the database M2 Implement a fully LO2 & 3
system with evidence of functional database systemD2 Evaluate the effectiveness
user interface, output and which includes system security
of the database solution in
data validations, and and database maintenance. relation to user and system
querying across multiple requirements, and suggest
tables. M3 Assess whether meaningful improvements.
data has been extracted
P3 Implement a query through the use of query tools
language into the relational to produce appropriate
database system. management information.

P4 Test the system against M4 Assess the effectiveness of


user and system the testing, including an
requirements. explanation of the choice of
test data used.
P5 Produce technical and M5 Produce technical and user D3 Assess any future
user documentation. documentation for a fully improvements that may be
functional system, including ER required to ensure the continued
Diagram and normalization effectiveness of the database
system.
statements and describing how
the system works.
Table of Contents
Unit 2: Website Designe and Development .................................................................................................... 1
P2 Develop the database system with evidence of user interface, output and data validations, and querying
across multiple tables. .................................................................................................................................. 1
1. Code snippets to create each table .................................................................................................... 1
1.1. Create database “ Online Management Library” ................................................................................. 1
1.2. Create table staff .................................................................................................................................. 1
1.3. Create table reader ............................................................................................................................... 1
1.4. Create table Author .............................................................................................................................. 1
1.5. Create table Category ........................................................................................................................... 2
1.6. Create table Publisher........................................................................................................................... 2
1.7. Create table Position............................................................................................................................. 2
1.8. Create table Languages......................................................................................................................... 2
1.9. Create table Book ................................................................................................................................. 3
1.10. Create table Bill ................................................................................................................................. 3
1.11. Create table Bill Detail ...................................................................................................................... 3
2. Code snippets to insert some sample data for each table ................................................................... 4
2.1. Data for table staff ................................................................................................................................ 4
2.2. Data for reader...................................................................................................................................... 4
2.3. Data for table author ............................................................................................................................ 4
2.4. Data for table category ......................................................................................................................... 5
2.5. Data for table publisher ........................................................................................................................ 5
2.6. Data for table position .......................................................................................................................... 6
2.7. Data for table languages ....................................................................................................................... 7
2.8. Data for table book ............................................................................................................................... 7
2.9. Data for table bill .................................................................................................................................. 8
2.10. Data for table billdetail ..................................................................................................................... 9
3. Generated Database Diagram of your Implementation..................................................................... 10
M2 Implement a fully functional database system which includes system security and database maintenance.
.................................................................................................................................................................. 11
P3 Implement a query language into the relational database system. .......................................................... 12
1. Code snippets to update some sample data for each table ............................................................... 12
1.1. Update staff table ............................................................................................................................... 12
1.2. Update author table ........................................................................................................................... 12
1.3. Update languages table ...................................................................................................................... 12
2. Code snippets to delete some sample data for each table ................................................................ 13
2.1. Delete language table ......................................................................................................................... 13
2.2. Delete book table................................................................................................................................ 13
3. Excute information retrivalstatements ............................................................................................. 13
3.1. Find special information amount book that reader borrowed........................................................... 13
3.2. Find special information in Bill Detail ................................................................................................. 14
3.3. Find special information in Bill........................................................................................................ 14
M3 Assess whether meaningful data has been extracted through the use of query tools to produce
appropriate management information. ....................................................................................................... 15
P4 Test the system against user and system requirements. ......................................................................... 16
M4 Assess the effectiveness of the testing, including an explanation of the choice of test data used. ........... 19
D2 Evaluate the effectiveness of the database solution in relation to user and system requirements, and
suggest improvements. .............................................................................................................................. 19
1. Database – advantages and disadvantages ...................................................................................... 19
1.1. Advantages.......................................................................................................................................... 19
1.2. Disadvantages ..................................................................................................................................... 19
2. Suggest improvements .................................................................................................................... 20
P5 Produce technical and user documentation. ........................................................................................... 20
1. Hardware requirement: ................................................................................................................... 20
2. Software requirement: .................................................................................................................... 20
3. Instruction for technical users:......................................................................................................... 21
M5 Produce technical and user documentation for a fully functional system, including ER Diagram and
normalization statements and describing how the system works................................................................. 21
D3 Assess any future improvements that may be required to ensure the continued effectiveness of the
database system. ....................................................................................................................................... 21
Table of Figures
Figure 1 Table of Staff ............................................................................................................................................... 4
Figure 2 Table of Reader ........................................................................................................................................... 4
Figure 3 Table of Author ........................................................................................................................................... 5
Figure 4 Table of Category ........................................................................................................................................ 5
Figure 5 Table of Publisher ....................................................................................................................................... 5
Figure 6 Table of Position ......................................................................................................................................... 6
Figure 7 Table of Languages ..................................................................................................................................... 7
Figure 8 Table of Book .............................................................................................................................................. 8
Figure 9 Table of Bill.................................................................................................................................................. 8
Figure 10 Table of BillDetail ...................................................................................................................................... 9
Figure 19 Database Diagr ........................................................................................................................................ 10
Figure 20 Show reader ............................................................................................................................................ 11
Figure 21 Add category ........................................................................................................................................... 11
Figure 22 Add staff .................................................................................................................................................. 12
Figure 11 Update staff table ................................................................................................................................... 12
Figure 12 Update author table ............................................................................................................................... 12
Figure 13 Update languages table .......................................................................................................................... 13
Figure 14 Delete languages table ........................................................................................................................... 13
Figure 15 Delete book table.................................................................................................................................... 13
Figure 16 Find special information amount book that reader borrowed............................................................... 14
Figure 17 Find special information in Bill Detail table ............................................................................................ 14
Figure 18 Find special information in Bill table ...................................................................................................... 15
ASSIGNMENT 2 ANSWERS
P2 Develop the database system with evidence of user interface, output and data validations,
and querying across multiple tables.
1. Code snippets to create each table
1.1. Create database “ Online Management Library”

--- CREATE DATABASE " ONLINE MANAGEMENT LIBRARY"---

create database OnlineManagementLibrary

1.2. Create table staff

--- CREATE TABLE STAFF---


create table staff
(
staffID char(10) not null primary key,
staffName varchar(50) not null,
staffAge int null,
staffPhone int not null unique(staffPhone),
staffAddress varchar(50) not null,
staffAccount varchar(50) not null,
staffPassword int not null
);

StaffID staffName staffAge staffPhone staffAddress staffAccount stafffPassword

1.3. Create table reader

--- CREATE TABLE READER ---

create table Reader


(
readerID char(10) not null primary key,
readerName varchar(50) not null,
readerAge int null,
readerAddress varchar(50) null,
CitizenID int not null
);
readerID readerName readerAge readerAddress CitizenID

1.4. Create table Author

---CREATE TABLE Author---


create table Author
(
authorID char(10) not null primary key,
authorName varchar(50) not null,
authorAddress varchar(50) null
);

Page |1
authorID authorName authorAddress

1.5. Create table Category

---CREATE TABLE Category ---


create table Category
(
categoryID char(10) not null primary key,
categoryName varchar(50) not null
);
categoryID categoryName

1.6. Create table Publisher

---CREATE TABLE Publisher---


create table Publisher
(
publisherID char(10) not null primary key,
publisherName varchar(50) not null,
publisherAddress varchar(50) null
);

publisherID publisherName publisherAddress

1.7. Create table Position

---CREATE TABLE Position---


create table Position
(
positionID char(10) not null primary key,
bookRow varchar(10) not null,
bookShelf varchar(10) not null,
compartment varchar(10) not null
);

positionID bookrow bookshelf compartment

1.8. Create table Languages

---CREATE TABLE Languages---


create table Languages
(
languageID char(10) not null primary key,
languageName varchar(50) not null
);

languageID languageName

Page |2
1.9. Create table Book

--- CREATE TABLE BOOK ---


create table Book
(
bookID char(10) not null primary key,
bookName varchar(50) not null,
authorID char(10) not null,
categoryID char(10) not null,
publisherID char(10) not null,
positionID char(10) not null,
languageID char(10) not null

foreign key (authorID) references Author,


foreign key (categoryID) references Category,
foreign key (publisherID) references Publisher,
foreign key (positionID) references Position,
foreign key (languageID) references Languages,
);

bookID bookName authorID categoryID publisherID positionID languageID

1.10. Create table Bill

---CREATE TABLE BILL---


create table Bill
(
billID char(10) not null primary key,
readerID char(10) not null,
staffID char(10) not null,
borrowDate date not null,
dueDate date not null

foreign key (readerID) references Reader,


foreign key (staffID) references staff
);

billID readerID staffID Borrowdate duedate

1.11. Create table Bill Detail

---CREATE TABLE Bill Detail---


create table BillDetail
(
billID char(10) not null,
bookID char(10) not null,
Quantity int not null,
returnDate date null,

foreign key (billID) references Bill,


foreign key (bookID) references Book,
constraint PK_BD primary key (billID,bookID)
);
billID bookID quantity returnDate

Page |3
2. Code snippets to insert some sample data for each table
2.1. Data for table staff

--- INSERT INFORMATION OF STAFF---


Insert into staff
(staffID,staffName,staffAge,staffPhone,staffAddress,staffAccount,staffPassword)
Values ('1001',' Dang An Thanh','20','0918414253','District10','thanh1001','0123456789');
Insert into staff
(staffID,staffName,staffAge,staffPhone,staffAddress,staffAccount,staffPassword)
Values ('1002',' Nguyen Thi Hong Dan','20','0942757177','District3','dan1002','0123456789');

Figure 1 Table of Staff

2.2. Data for reader

---INSERT INFORMATION READER---


insert into Reader (readerID,readerName,readerAge,readerAddress)
values ('GCS190634','Vu Hoai Thao My','20','District 8');
insert into Reader (readerID,readerName,readerAge,readerAddress)
values ('GCS190574','Nguyen Vuong Thai Bao','20','Binh Chanh District');
insert into Reader (readerID,readerName,readerAge,readerAddress)
values ('GCS190062','Tran Dai phu','20','District 8');
insert into Reader (readerID,readerName,readerAge,readerAddress)
values ('GCS190703','Tran Dang My Ngan','20','Binh Chanh District');

Figure 2 Table of Reader

2.3. Data for table author

---INSERT INFORMATION AUTHOR---


insert into Author (authorID,authorName,authorAddress)
values ('190101','Joan M Saslow','USA');
insert into Author (authorID,authorName,authorAddress)
values ('190102','Sean Liao','English');
insert into Author (authorID,authorName,authorAddress)
values ('190103','Paulo Coelho','English');
insert into Author (authorID,authorName,authorAddress)
values ('190104','Andre Aciman','America');

Page |4
Figure 3 Table of Author

2.4. Data for table category

---INSERT INFORMATION CATEGORY---


insert into Category (categoryID,categoryName)
values ('180101','Text Book');
insert into Category (categoryID,categoryName)
values ('180102','Fiction');

Figure 4 Table of Category

2.5. Data for table publisher

---INSERT INFORMATION PUBLISHER---


insert into Publisher (publisherID,publisherName,publisherAddress)
values ('170101','Pearson Education','USA');
insert into Publisher (publisherID,publisherName,publisherAddress)
values ('170102','Springer-Verlag Berlin and Heidelberg GmbH','English');
insert into Publisher (publisherID,publisherName,publisherAddress)
values ('170103','Harper Collins Publ.UK','UK');
insert into Publisher (publisherID,publisherName,publisherAddress)
values ('170104','Atlantic Books','English');

Figure 5 Table of Publisher

Page |5
2.6. Data for table position

---INSERT INFORMATION POSITION---


insert into Position (positionID,bookRow,bookShelf,compartment)
values ('111','A','1','1');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('112','A','1','2');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('113','A','1','3');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('114','A','1','4');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('115','A','1','5');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('116','A','2','1');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('117','A','2','2');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('118','A','2','3');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('119','A','2','4');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('120','A','2','5');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('121','A','3','1');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('122','B','1','1');
insert into Position (positionID,bookRow,bookShelf,compartment)
values ('123','B','1','2');

Figure 6 Table of Position

Page |6
2.7. Data for table languages

---INSERT INFORMATION LANGUAGES---


insert into Languages (languageID,languageName)
values ('160101','English');
insert into Languages (languageID,languageName)
values ('160102','VietNamese');
insert into Languages (languageID,languageName)
values ('160103','French');
insert into Languages (languageID,languageName)
values ('160104','Campudia');

Figure 7 Table of Languages

2.8. Data for table book

---INSERT INFORMATION BOOK---


insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001001','Top Notch 1','190101','180101','170101','111','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001002','Top Notch 2','190101','180101','170101','112','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001003','Top Notch 3','190101','180101','170101','113','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001004','Top Summit 1','190101','180101','170101','114','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001005','Top Summit 2','190101','180101','170101','115','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001006','Top Notch 1 workbook','190101','180101','170101','116','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001007','Top Notch 2 workbook','190101','180101','170101','117','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001008','Top Notch 3 workbook','190101','180101','170101','118','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001009','Top Summit 1 workbook','190101','180101','170101','119','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001010','Top Summit 2 workbook','190101','180101','170101','120','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001011','Migrating to Swift from Web
Development','190102','180101','170102','121','160101');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001012','Sean Liao','190103','180102','170103','122','160102');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001013','Call Me By Your Name','190104','180102','170104','123','160102');
insert into Book (bookID,bookName,authorID,categoryID,publisherID,positionID,languageID)
values ('1001014','WHO ARE YOU','190104','180102','170104','123','160102');

Page |7
Figure 8 Table of Book

2.9. Data for table bill

---iNSERT INFORMATION BILL---


insert into Bill (billID,readerID,staffID,borrowDate,dueDate)
values ('001','GCS190062','1001','2020-10-19','2020-10-26');
insert into Bill (billID,readerID,staffID,borrowDate,dueDate)
values ('002','GCS190574','1001','2020-10-19','2020-10-26');
insert into Bill (billID,readerID,staffID,borrowDate,dueDate)
values ('003','GCS190634','1002','2020-10-20','2020-10-26');
insert into Bill (billID,readerID,staffID,borrowDate,dueDate)
values ('004','GCS190703','1002','2020-10-20','2020-10-26');

Figure 9 Table of Bill

Page |8
2.10. Data for table billdetail

---INSERT INFORMATION BILLDETAIL---


insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('001','1001001','1','2020-10-20');
insert into BillDetail (billID,bookID,Quantity, returnDate)
values ('001','1001006','1',null);
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('002','1001002','1','2020-10-23');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('002','1001007','1','2020-10-25');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('002','1001012','1','2020-10-25');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('002','1001013','1',null);
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('003','1001004','1','2020-10-22');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('003','1001009','1',null);
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('003','1001012','1',null);
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('004','1001007','1','2020-10-24');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('004','1001010','1','2020-10-25');
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('004','1001011','1',null);
insert into BillDetail (billID,bookID,Quantity,returnDate)
values ('004','1001012','1',null);

Figure 10 Table of BillDetail

Page |9
3. Generated Database Diagram of your Implementation

Figure 11 Database Diagr

P a g e | 10
M2 Implement a fully functional database system which includes system security and database
maintenance.
1. Procedures of SQL

use OnlineManagementLibrary
---SHOW READER ---
create procedure Show_Reader
as
begin
select * from Reader
end
exec Show_Reader

Figure 12 Show reader


--- ADD CATEGORY---
CREATE PROCEDURE addcategory
AS
INSERT INTO Category VALUES('180103','autobiography')

exec addcategory

select*from Category

Figure 13 Add category


--- ADD STAFF---
CREATE PROCEDURE addstaff (@staffID char(10)
, @staffName varchar(50)
, @staffAge int
, @staffPhone int
, @staffAddress varchar(50)
, @staffAccount varchar(50)
, @staffPassword int)
AS
INSERT INTO staff
VALUES(@staffID,@staffName,@staffAge,@staffPhone,@staffAddress,@staffAccount,@staffPassword)

exec addstaff'1003','Trương Minh Quang','19','0918414254','Binh Thanh District','quang1003'


,'0123456789'
P a g e | 11
Figure 14 Add staff

P3 Implement a query language into the relational database system.


1. Code snippets to update some sample data for each table

1.1. Update staff table


---UPDATE STAFF TABLE---
UPDATE staff
SET staffAddress = 'District 8'
WHERE staffID = 1001

Figure 15 Update staff table

1.2. Update author table


---UPDATE READER TABLE---
UPDATE Author
SET authorAddress = 'America'
WHERE authorID = 190101

Figure 16 Update author table

1.3. Update languages table


---UPDATE LANGUAGES TABLE---
UPDATE Languages
SET languageName = 'Japanese'
WHERE languageID = 160104

P a g e | 12
Figure 17 Update languages table

2. Code snippets to delete some sample data for each table


2.1. Delete language table
--- DELETE LANGUAGES TABLE---
DELETE FROM Languages
WHERE languageID = 160104

Figure 18 Delete languages table

2.2. Delete book table


---DELETE BOOK TABLE---
DELETE FROM Book
WHERE bookID = 1001014

Figure 19 Delete book table

3. Excute information retrivalstatements


3.1. Find special information amount book that reader borrowed
P a g e | 13
select R.readerID,R.readerName, SUM (BD.Quantity) as total
from Reader R, Bill B, BillDetail BD
where B.billID =BD.billID and R.readerID=B.readerID
group by R.readerID,R.readerName

Figure 20 Find special information amount book that reader borrowed

3.2. Find special information in Bill Detail

select BK.bookID,BK.bookName, SUM (BD.Quantity) as Quantity


from BillDetail BD, Book BK
where BD.bookID = BK.bookID
group by BK.bookID, BK.bookName

Figure 21 Find special information in Bill Detail table

3.3.Find special information in Bill


select B.billID,BD.returnDate,R.readerName,S.staffName,BK.bookName,BD.Quantity
from Bill B,BillDetail BD,Reader R, staff S, Book BK
WHERE B.billID =BD.billID and B.staffID = S.staffID and B.readerID=R.readerID and
BD.bookID=BK.bookID

P a g e | 14
Figure 22 Find special information in Bill table

M3 Assess whether meaningful data has been extracted through the use of query tools to produce
appropriate management information.
- They help us to access local as well as remote data easily.

• They have integrated – robust report writing feature.

• Most of the query tools are built upon client-server architecture, so provide complete client-
server support.

• SQL Server is more robust query tool than SQL for MS Access.

• Oracle as a query tool is bulky and mostly useful for large databases;

- therefore SQL Server is more preferable and most widely used

P a g e | 15
P4 Test the system against user and system requirements.

Test What is being tested How <syntax> Test data used Expected results
Staff ID = 1001
Staff Name = Dang An Thanh
Staff Age = 20
INSERT <table_name> All information are inserted into
1 Input data into Staff Staff Phone = 0918414253
VALUES <values> staff table successfully.
Staff Address = District 10
Staff Account = thanh1001
Staff Pass Word = 0123456789
Reader ID = GCS190644 All information are inserted into
INSERT <table_name> Reader Name = Vu Hoai Thao My reader table successfully.
2 Input data into reader
VALUES <values> Reader Age = 20
Reader Address = District 8
Author ID = 190101
INSERT <table_name> All information are inserted into
3 Input data into author Author Name = Joan M Saslow
VALUES <values> author table successfully.
Author Address = USA
INSERT <table_name> Category ID = 180101 All information are inserted into
4 Input data into category
VALUES <values> Category Name = Text book category table successfully.
Publisher ID = 170101
INSERT <table_name> Publisher Name = Pearson All information are inserted into
5 Input data into publisher
VALUES <values> Education publisher table successfully.
Publisher Address = USA
Position ID = 111
INSERT <table_name> Book Row = A All information are inserted into
6 Input data into position
VALUES <values> Book shelf = 1 position table successfully.
Compartment = 1
INSERT <table_name> Languages ID = 160101 All information are inserted into
7 Input data into languages
VALUES <values> Languages Name = English languages table successfully.

P a g e | 16
Book ID = 1001001
Book Name = Top Notch 1
Author ID = 190101
INSERT <table_name> All information are inserted into
8 Input data into book Category ID = 180101
VALUES <values> book table successfully.
Publisher ID = 170101
Position ID = 111
Languages ID = 160101
Bill ID = 001
Reader ID = GCS190062
INSERT <table_name> All information are inserted into
9 Input data into bill Staff ID = 1001
VALUES <values> bill table successfully.
Borrow date = 2020-10-19
Due date = 2020-10-26
Bill ID = 001
INSERT <table_name> Book ID = 1001001 All information are inserted into
10 Input data into bill detail
VALUES <values> Quantity = 1 bill detail table successfully.
Return Date = 2020-10-20
UPDATE < table_name>
Update data in table staff,
SET < column_name = values> Staff Address = District 8 The text ‘ District 8’ is inserted into
11 column staffAddress at
staff ID = 1001 the row staffID = 1001
the row staffID = 1001 SET < search condition>
Update data in table UPDATE < table_name>
author , column author Author Address = America The text ‘America’ is inserted into
12 SET < column_name = values>
address at the row Author ID = 190101 the row authorID=190101
authorID = 190101 SET < search condition>
Update data in table
UPDATE < table_name>
languages , column
Languages Name = Japanese The text ‘Japanses’ is inserted into
13 languages name at the SET < column_name = values>
Languages ID = 160104 the row languagesID=190104
row languagesID =
SET < search condition>
160104

P a g e | 17
Delete date in table
DELATE FROM < table_name>
languages, column The row which contain
Languages ID = 160104 of
14 langauges name at the [WHERE < search condition>] information of languagesID =
languages table
row languages ID 160105 is deleted
=160104
Delete date in table book DELATE FROM < table_name>
The row which contain
, column bookname at
15 [WHERE < search condition>] Book ID = 1001014 of book table information of bookID=1001014 is
the row book ID
deleted.
=1001014
SELECT
Bill ID
<column_name1>..<column_nameN> Return Date
Find speical information FROM<table_name> Reader Name All of the bill table will be
16
in table bill Staff Name appeared.
GROUP BY <column _name> Book Name
Quantity

SELECT
<column_name1>..<column_nameN>
Find speical amount Reader ID
FROM<table_name> All of information in table will be
17 boook that reader Reader Name
appeared.
borrowed GROUP BY <column _name> Total

P a g e | 18
M4 Assess the effectiveness of the testing, including an explanation of the choice of test data used.
- My testing aims to ensure that the basic information needed will be in the tables and the tables will be
bound together. The effect of my testing can be a lot of bugs and not perfect, however I think some will
be good over the time in development, maintenanceand and storing data. My tests are all very good
and it has no underlying errors. So I don't have to fix or change anything for my coding .

- In the case of testing, I performed the necessary basic tests, in which I did things like insert, update,
delete, select. I used my data to perform tests, because I wanted to make sure my data was working
properly.

- I will explain every possible syntax. The insert syntax is used to insert information into tables. The
update syntax is used to edit information and update the new information you want. The syntax delete
is used to delete unnecessary information. The syntax select is implemented to display the information
saved in the tables

- The relationship between the tables is necessary, so I need to check that it works and is right. If you
want to insert data into a foreign key, you must have the foreign key in the table and the relationship
containing the foreign key. Just like deleting needs to be deleted in a table with a reference first.

- Through the guidance of the teachers and researching on the internet, I have designed a complete
database for this report. I think it is not the perfect or the best design, but I think it has met the basic
requirements of a database system. It works well and there are no basic errors about insert, update,
delete, select in my testing

D2 Evaluate the effectiveness of the database solution in relation to user and system requirements,
and suggest improvements.
1. Database – advantages and disadvantages

1.1. Advantages

❖ Reduced data redundancy

❖ Reduced updating errors and increased consistency

❖ Greater data integrity and independence from applications programsImproved data access to
users through use of host and query languages

❖ Improved data security

❖ Reduced data entry, storage, and retrieval costs

❖ Facilitated development of new applications program

1.2. Disadvantages

P a g e | 19
❖ Database systems are complex, difficult, and time-consuming to design

❖ Substantial hardware and software start-up costs

❖ Damage to database affects virtually all applications programs

❖ Extensive conversion costs in moving form a file-based system to a

❖ database system

❖ Initial training required for all programmers and users

2. Suggest improvements

❖ Use of supporting software when using database development software. For

❖ example, use the SQL Prompt software when using SQL Server to have the

❖ code show automatically

❖ Databases are stored in the cloud, reducing storage in hardware and software

❖ Sharing the cost of using the software

❖ Strengthening the database security. For example, regularly updating developer patches
Software development easier to use and easier to operate

P5 Produce technical and user documentation.


1. Hardware requirement:

• Minimum of 6 GB of available hard-disk space.

• Super-VGA (800x600) or higher resolution monitor.

• CPU core i5, 2.0GHz , RAM 4GB, HDD/SSD 256GB…

• Clocks peed of 2 GHz or more. 1.4 GHz minimum.

• 64 bit x64-compatible AMD or Intel CPU only.


2. Software requirement:

• Visual studio 2017 for design UI or/ HTML, CSS for design UI.

• SQL server core engine is 64-bit only and does not support the 32-bit editions of windows 8 or
window 10.
P a g e | 20
• SQL server need hard disk space of 8030 MB.

• Microsoft SQL Server 2017.


3. Instruction for technical users:
1.1. Connect to a SQL Server instance
- To connect to the SQL Server using the Microsoft SQL Server Management Studio, you use
these steps:

• First, launch the Microsoft SQL Server Management Studio from the Start menu:

• Next, from the Connect menu under the Object Explorer, choose the Database Engine…

• Then, enter the information for the Server name (localhost), Authentication (SQL Server
Authentication), and password for the sa user and click the Connect button to connect to the
SQL Server.
M5 Produce technical and user documentation for a fully functional system, including ER Diagram
and normalization statements and describing how the system works.
Passed the test in P4, It has sovled the basics of Online Management Library, but there is one shortcoming that
had not found the list of readers who have not return the book.

D3 Assess any future improvements that may be required to ensure the continued effectiveness of
the database system.
In the future, it is necessary to futher improve the discovery of the list readers who have not returned
book. So staff can know that book not yet paid and it is past the deadline? statistics can be strictly
controlled

P a g e | 21
REFERENCES
1. Lecture 6 – Physical Design [Online] At available:
https://cms.greenwich.edu.vn/mod/resource/view.php?id=26689 [Accessed 20 Oct. 2020].

2. Lecture 7- Over view of SQL [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26690 [Accessed 20 Oct. 2020].
3. Lecture 8 -Transact SQL [Online] At available:
https://cms.greenwich.edu.vn/mod/resource/view.php?id=26691 [Accessed 21 Oct. 2020].

4. Lecture 9 -Querrying Data [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26692 [Accessed 21 Oct. 2020].
5. Lecture 10 – Tables and Constraint [Online] At available:
https://cms.greenwich.edu.vn/mod/resource/view.php?id=26693 [Accessed 22 Oct. 2020].

6. Lecture 11 – Advance querries [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26694 [Accessed 22 Oct. 2020].

7. Lecture 12 -Indexes Views [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26695 [Accessed 23 Oct. 2020].

8. Lecture 13 -Stored Procedures [Online] At avaible:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26696 [Accessed 25 Oct. 2020].

9. Lecture 14 – Triggers [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26697 [Accessed 25 Oct. 2020].

10. Lecture 15 -Testing and tesing data [Online] At available:


https://cms.greenwich.edu.vn/mod/resource/view.php?id=26698 [Accessed 26 Oct. 2020].

11. WIKIPEDIA. Data retention [Online] At available: https://en.wikipedia.org/wiki/Data_retention


[Accessed 27 Oct. 2020].

12. Microsoft.Securing SQL server [Online] at available: https://docs.microsoft.com/en-


us/sql/relational-databases/security/securing-sql-server?view=sql-server-ver15 [Accessed 27
Oct. 2020].

P a g e | 22

You might also like