Note: Nếu muốn support C, C#, Networking, Database, project web, 1633, security_zalo 0962.986.805 or fb https://www.facebook.com/profile.php?id=100080073517431. Assignment 2 môn Database (1622) đại học Greenwich, bài luận đạt điểm Merit năm 2021, có trích dẫn học thuật chuẩn Harvard, liên hệ với mình nếu bạn muốn support với mức giá phù hợp. Develop the database system, Final Mockup of the application, Queries to create database with results, Security, Produce queries, Advanced query, Evaluate the effectiveness of the database solution, Test case, Flowchart to show how the system works
Trang 1ASSIGNMENT 2 FRONT SHEETQualification TEC Level 5 HND Diploma in Computing
Unit number and title Unit 04: Database Design & Development
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism I understand thatmaking a false declaration is a form of malpractice
Student’s signature Grading grid
Trang 22.1
Signature & Date:
Trang 3Table of Contents
Introduction 1
1 Develop the database system 1
1.1 Final Mock-up of the application 1
1.2 Queries to create database with results 7
1.3 Data in database system 12
1.4 Security 14
2 Produce queries 16
2.1 Insert into, delete, update 16
2.2 Select 18
2.3 Advanced query 19
2.4 Evaluate the effectiveness of the database solution 24
3 Test the system 24
3.1 Test case 24
3.2 Flowchart to show how the system works 25
Conclusion 32
Trang 4In this assignment, a database of online library system has been deployed on SQL serverbased on query language This database provides, allows editing, deleting, and insertingnecessary information to maintain the library such as personal information of members,staff, login, book information, loan vouchers It is also designed with statistics to helpadministrators easily manage and know the status of the library Here, a complete mock-upalong with a relational database has also been designed and displayed Testing is alsoconducted to fix bugs Finally, a technical document was developed to guide users in usingthis system based on the mock-up
1 Develop the database system
1.1 Final Mock-up of the application
Based on the old mock-up designs in the previous assignment, a full blueprint of the system wasbuilt This update provides new functions for querying statistics for library management
Figure 1: Login interface
Trang 5Figure 2: Main interface for staff
Figure 3: Information of staff
Trang 6Figure 4: CRUD (Create/Read/Update/Delete) information of book (part 1)
Figure 5: CRUD information of book (part 2)
Trang 7Figure 6: View information of readers
Figure 7: CRUD borrowing
Trang 8Figure 8: Borrow Detail
Figure 9: Return Book
Trang 9Figure 10: Statistic activity
Figure 11: Main interface for reader
Trang 10Figure 12: Information of reader
1.2 Queries to create database with results
Based on the designs approved by the CEO, a database system will be generated by the
query that creates the table They will be displayed with the results once run
Figure 13: Query to create database ASM and table Member
Trang 11To build a database system, a database must be created in SQL Server, ASM is the databasecreated and used to store this library system The tables will be created by the queries sothat the field names, data types, data validation are designed.
Figure 14: Table Member
Figure 15: Query to create table Staff, Login and Author
Figure: Table Staff
Trang 12Figure 16: Table Login
Figure 17: Table Author
Figure 18: Query to create table Book and Borrow
Trang 13Figure 19: Table Book
Figure 20: Table Borrow
Figure 21: Query to create table BorrowDetail and ReturnBook
Trang 14Figure 22: Table BorrowDetail
Figure 23: Table ReturnBook
Figure 24: Final diagram
Trang 151.3 Data in database system
The system will import the existing data, because the new system is built and the amount ofdata is large, the data will be imported through the built-in tool on the SQL Server system,
so these input data will not be available using query language
Figure 25: Table Login
Figure 26: Table Borrow
Figure 27: Table Member
Trang 16Figure 28: Table Author Figure 29: Table Staff
Figure 30: Table Book
Figure 31: Table ReturnBook
Figure 32: Table BorrowDetail
Trang 171.4 Security
Figure 33: Query to create role Staff to login
Trang 18For login, 2 permissions are set as Staff and Member roles For staff, grant select, update,
delete, alter permissions for all tables, in the permission there are 2 accounts of staff
For the Member role, grant update permission in the members table for accounts that havethis permission.
These two images are the login screen, the login
account has the role of Member, so it only has
permissions in the member table
Trang 192 Produce queries
2.1 Insert into, delete, update
Users can manipulate operations such as insert, delete, update on the database With
Insert, user uses Insert into to add data to the Borrow and BorrowDetail tables
Figure 33: Query to insert
Figure 35: Result at Borrow
Figure 36: Result at BorrowDetail
Trang 20A title is deleted at Book and result
Figure 37: Query to delete
Figure 38: Result at Book
With update, the record in the Author table with ID = 126 will be edited Lastname and the
result
Figure 39: Query to update
Figure 40: Result at Author
Trang 212.2 Select
Figure 41: Query to select Students' borrowing times and result
Figure 42: Query to select Borrowed book rating and result
Figure 43: Published 2010 to present and result
Trang 22Figure 44: Query to select number of times staff lent books and result
2.3 Advanced query
Figure 45: Query to create procedure Check_borrow_activity and result
Trang 23Figure 46: Query to create procedure CheckOperation
Trang 24Figure 47: Query to create procedure All_Borrow
Trang 25Figure 48: Query to create procedure check status and cost in Borrow and result
Trang 26Figure 49: Query to create table trigger tg_updel
Figure 50: Test and result of trigger tg_updel
Trang 272.4 Evaluate the effectiveness of the database solution
Based on the requirements of the online library, important tables have been built that are
Login to log in, distinguish between members and employees, Member to build basic
information of members such as name, ID, date birth, phone number; Staff includes ID
information, name of staff; basic information of the book and the corresponding author's
name, price, and quantity Regarding the loan slip, 3 tables are built to take on 3 different
roles, Borrow displays information of the borrower, borrowing date, return date,
BorrowDetail records details of the type of book, ReturnBook records information when
returning books The datavalidation is also set up so that the information entered is correct,
the information in the secondary table will be edited or deleted if the information in the
main table is edited or deleted Essentially, these tables make the library easy to operate In
addition, users can add, edit, delete, read data Next, statistical operations use select, a
procedure that makes it easy for managers to control library activities Trigger helps to save
Member information when updating or deleting records A user-friendly mock-up that has
been built along with a detailed instruction on how it works is necessary for the users to
fully understand the system's features and usage
In short, the system has met most of the user's needs
3 Test the system
3.1 Test case
To see performance, find errors and fix them, a test plan is essential for the database
Table 1: Test plan
ID
Format_PhoneNumber PhoneNumber
check of Table
Member
2 On update cascade of Update ID of Update Staff set ID=’G113’ At IDstaff = ‘G111’ of Login
Trang 284 Procedure Execute 3 Top 3 types of books with the
command
update,delete ('GCH012','Hoang','Anh','2002- activities
select table
'2003-1-1' where ID ='GCH012'
delete from Memberwhere ID = 'GCH012'
Table 2: Test Result
Format_PhoneNumbercheck of Table Member
IDstaff in Login
Check_Borrow_activity March to June 2021
CheckOperation
3.2 Flowchart to show how the system works
In order for users to understand the system, a technical document to guide how to use the
system has been developed
Trang 29Figure 51: Login interface
Users will choose the Staff or Member role and enter their personal account and password
to log in
Format of Account is email of university For example: hoangnam@fe.edu.vn
Trang 30The main interface of the staff is displayed with 5 options, click to select the correspondingfunction With options 1, 3, 4, users can search for IDs to update, delete, and insertinformation of objects For option 2, the user can only view the information Format ID ischar (4), ‘G[0-9][0-9][0-9] For example: G111
Figure 53: Option 1 (part 1)
Figure 54: Option 1 (part 2)
Trang 31Format Quantity, Cost is >0, Publication Year < present
Figure 55: Option 2
Figure 56: Option 3
Trang 32Figure 57: Option 4 (part 1)
Figure 58: Option 4 (part 2)
Trang 33Figure 59: Option 4 (part 3)
Format Status is Good or Bad.
Trang 34Users can use 9 different options to view statistical information, for option 5, 2 time pointsmust be entered including month and year of each landmark for statistics, for option 6, thenumber must be entered.
For member accounts, users must enter personal information to proceed with borrowingbooks Some of the formats are ID: 6 characters and follow the pattern G_H[0-9][0-9][0-9].For example: GCH001 The date of birth is less than the current date, the phone numberconsists of 10 digits from 0-9
Figure 61: Member interface
Figure 62: Information of member
Trang 35In this assignment, a basic database has been built for an online library system of FPTUniversity, all necessary tables along with statistical operations, adding, editing and deletinghave been built in a query language on SQL server The system grants permissions for 2user roles, Staff and Member, basically, the system has fully met the needs of users Theinterface is designed to be simple but full of options needed for library management andstatistics for library development In the future, the database will be expanded and addmany new statistical queries for users
32
Trang 36Index of comments
2.1 You have completed the ASM 2 report The primary sections of the P-criteria include:
Building interfaces.
Creating simple to complex manipulations and queries statements (including triggers) and system testing
by primary test cases.
Building complete user documentation.
You also made the database security mode by delegating user permissions on the database However, as explained in the theoretical lecture, this user delegation needs to be done at the application layer, when user delegation at the database management system only applies to users who design and administer the database Whether You already have an evaluation of the database, but you only evaluated the effectiveness of the database design option, did not mention future improvements.