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 1 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. User and system requirement, Design the relational database system, Data validation, Normalization of the database, Wireframe of the application, Evaluation.
Trang 1ASSIGNMENT 1 FRONT SHEET
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 User and system requirement 1
1 1 Overview about the problem 1
1.2 Requirement of the application 1
1.2.1 Process of library 1
1.2.2 Requirement 2
1.2.3 Input/Output 2
2 Design the relational database system 4
2.1 Analyse the requirement 4
2.2 Database design with explanations 5
2.3 Normalization of the database 6
2.4 List of tables 7
2.5 Data validation 12
2.6 Wireframe of the application 13
2.7 Evaluation 18
2.7.1 Advantage 18
2.7.2 Disadvantage 19
2.7.3 Future development direction 19
Conclusion 20
Reference list 20
Trang 4Today, digital transformation technology is becoming a trend for many fields, especiallybusiness management models While offline libraries are gradually becoming obsolete, onlinelibraries are a good choice to develop this format In this assignment, the relational database for
an online library of FPT University is analyzed and built according to the user's requirements,functions, and necessary standards
1 User and system requirement
1 1 Overview about the problem
Currently, all universities have libraries but these offline libraries have become obsolete in theage of technology, it has many major defects that cause inconvenience to users First, thereader/user has to go to the library at a fixed location, which takes a long time Next, the searchand borrowing procedures are also complicated because the library has a lot of readers and ahuge number of books The management of the library is a dilemma, it is difficult for theadministrator to know the
status of all the books and the
borrowers In addition, the
Covid-19 epidemic is the
biggest cause, it makes the
library unable to operate,
which wastes resources and
staff Therefore, FPT
University needs a database to
solve the above problems
Figure 1: The offline library cannot operate due to the epidemic
of the books paid Each person in a loan can only borrow up to 3 books and the return period iswithin 1 month; when returning the book, it will check and record the condition of the book
Trang 5As a reader, I would like to edit and view personal information along with account password,some information such as loan date, employee name, book title should be clear so as not to beconfused about the details this information.
1.2.3 Input/Output
The input/output to the system will be the data of information of readers, staffs, and books, etc
Figure 2: Information of books
Figure 3: Information of staff
Trang 6Figure 4: Information of member
Figure 5: Login
Trang 7Figure 6: Information of borrowing
2 Design the relational database system
2.1 Analyse the requirement
In order to facilitate the construction of the database, and the system, the requirements will beclearly analyzed
Regarding login, the information to use is account (gmail), ID, password and Role Regardingthe information of the book, some of the main information to display is the title of the book,the date of publication, the publisher, the price, the number Furthermore, the author'sinformation must clearly display the first and last name
Regarding member information, readers will have some information to identify that is ID, lastname, first name; Date of Birth is also an important information for age statistics, PhoneNumber is an indispensable field, and Address Regarding Staff, ID is as important as member,
in addition Full name will appear in the database Regarding the loan, it will includeMembership Number, Employee, Borrow Code, Borrowing Date and Repayment Date
About BorrowDetail, ID is the count, IDborrow helps identify the borrow code because thereare many different loan vouchers, Quantity is the number of books borrowed (maximum 3books), and 3 Titles of 3 books Regarding ReturnBook, ID is the count, IDborrow helps toidentify the borrowed code, QuantityReturn is the number of books returned, Status is thestatus of the book is good or bad and Note to record notes if any
In terms of entities, it has Login, Member, Staff, Borrow, Author, Book, BorrowDetail, andReturnBook
Trang 82.2 Database design with explanations
Logical design (ERD) of database:
Figure 7: Entity relationship diagram
Entities are joined by 1-to-many association because the same information can be used morethan once and 1-to-1 association, for example, between Login entity and Member, Staff
The book entity should have fields that record detailed and important information for easysearching and statistics such as book title, author name, publication date, total number of books
in the library and its price The foreign key is set in the IDAuthor field to refer to the Authortable The Author entity only includes the ID as the primary key and two other fields,Firstname and Lastname, to identify the author's name
The Login entity needs Gmail for each user to log in with the password in the profile along withthe role and ID of the staff or member The primary key is Gmail, the foreign key includes theIDstaff and IDmember fields, depending on the role that refer to the Member or Staff entity
For Staff, the basic data is the name, the staff code for identification purposes, the ID is set asthe primary key For Members, the ID is also set as the primary key, in addition to informationthat needs detailed information, add an address field, a phone number for easy contact; Thedate of birth field makes statistics easy
Trang 9Borrowing entity, some basic information is the fields of member code, employee, borroweddate, return date for easier management IDborrow is the primary key, IDstaff and IDmemberare set as secondary keys to refer to the Staff and Member entities for the purpose of gettingthe ID.
Entity BorrowDetail has a primary key of ID to distinguish the data, IDborrow is a foreign keythat refers to entity Borrow to get information of borrowed tickets, Quantity is the borrowedquantity (up to 3), 3 foreign keys Title from 1 up to 3 references to the Book entity to get theTitle of the book, up to 3 books
The ReturnBook entity has a primary key that is ID to distinguish the data, IDborrow is a foreignkey that refers to the Borrow entity to get information about the loan slips, QuantityReturn is thequantity returned, Status is the status of the returned book, and Note field if required
2.3 Normalization of the database
Normalization is a database design method that starts with a look at the links between attributes(known as functional dependencies) (Connolly and Begg, 2015) In normalization, a number oftests are performed to identify the best grouping for these qualities and, as a result, anappropriate set of relations to satisfy the user's data needs
to preserve data integrity and the association between entities
The above condition and the condition of reaching 1NF normalization, entities have achieved2NF normalization
3NF Normalization:
At Book:
Primary Key ->Title
Trang 102.4 List of tables
Table 1: Entity Author (physical design)
Table 3: Entity Book (physical design)
Trang 11Table 5: Entity Staff (physical design)
Table 7: Entity Member (physical design)
8
Trang 12Table 9: Entity Borrow (physical design)
Date of borrow Date
Table 10: Borrow
Trang 13Table 11: Entity Login (physical design)
Table 12: Table Login
Table 13: Entity BorrowDetail
Trang 14Table 14: BorrowDetail
Table 15: Entity ReturnBook
Trang 152.5 Data validation
Data validation is simply understood as checking the input data is correct according to themeaning of that data or not (Riolo, 1986) Here, the email will be checked according to theschool's email format so that the users are only students and employees of the school Someinteger data will be formatted greater than 0; phone numbers are formatted as 10 numbers,starting with '0' followed by numbers 0 through 9 Some date data is formatted smaller than thecurrent date so that no errors are encountered in statistics or calculations
Table 17: Data validation of fields
Publication year Year X Like ‘[0-2][0-9][0-9][0-9]’
<= year(getdate())
PhoneNumber Char(10) Like ‘0[0-9][0-9][0-9][0-9][0-9][0-9]
[0-9][0-9][0-9]’
Trang 162.6 Wireframe of the application
The system will have two main interfaces because there are two user roles, staff and reader.For staffs, they can read, create, update, delete data about books, loan vouchers, personalinformation, view reader information, and perform certain statistics about data in the database.For readers, they can find, borrow books and edit personal information
Figure 8: Login interface
Figure 9: Main interface for staff
Trang 17Figure 10: Information of staff
Figure 11: CRUD (Create/Read/Update/Delete) information of book (part 1)
Trang 18Figure 12: CRUD information of book (part 2)
Figure 13: View information of readers
Trang 19Figure 14: CRUD borrowing
Figure 15: Borrow Detail
Trang 20Figure 16: Return Book
Figure 17: Main interface for reader
Trang 21Figure 18: Information of reader
2.7 Evaluation
The relational database for this library management system has basically been built However,
it will have advantages and disadvantages, they will be evaluated through a number of factorssuch as tools, design methods, results for users
2.7.1 Advantage
During the logical and physical design of the relational database, the draft will be designed on theSQL server so that it can be easily tested and checked SQL server is a great application to designand develop logical and physical relational databases for the system Developers can use the toolsavailable on this application to develop a simple database, the lines of code are also simple, easy tounderstand, and highly effective Can be used on many platforms such as PC, laptop, phone, etc.Can connect with many programming applications, and other support functions such as Securityare available Information is easily queried with simple statements, it can also detect errors in thecode ERD is designed using draw.io website, this is a good website that supports designing entitieswith available templates, ensuring aesthetics and accuracy
In terms of design method, entities and fields are created first All are consistent with theinformation of objects such as books, employees, and borrowers Clear, consistent data types makeentering information easy, especially the simplicity of memory cells of different data types thatmakes the information complete but doesn't waste a lot of memory This is necessary because adatabase will grow for a long time and the amount of data will increase over time, saving memory
is necessary Entities are linked together by 1-to-many and 1-to-1 links along with primary andforeign keys, making it easy to refer to information in other entities Normalizing data according to
3 levels of normalization helps to prevent data from being redundant and without errors whenperforming operations such as adding, editing, deleting, and updating Data
Trang 22validation helps to check whether the data is in the correct format of the manager, whichmakes data management and statistics easy because the data format will be unified.
For users who are staff and managers, querying information is easy because the entities arelinked by primary and foreign keys Moreover, the information at the table containing theprimary key cannot be deleted without deleting the information at the foreign key, in somecases, this will prevent data from being lost With the particularity of a library, informationabout books and loan slips, readers will always be edited, added, updated, and managed easilywith the database Information about entities, detailed fields for the characteristics of objectsare stored, so management and statistics become easy The statistics will help the managementknow the current status to build a development direction for the library, for example, based onthe loan card to know which books are borrowed the most, then buy more this genre booksbelonging for the library In the future, new properties will appear, updating them to thedatabase is not difficult For readers, their information can be completely edited easily, theycan query information about books and loan slips Security is an important issue, in thisdatabase, each person will have a separate account and password using the email of FPTUniversity, so outsiders cannot use this system, it also assigns suitable roles to users Thesimple interface, easy to understand for new employees also plays an important role in themanagement of this library system
For the library manager, all the not-null configuration information must be entered for theconvenience of statistical operations and calculations later, however, a problem is raised thatthere is a ratio small objects lack such information, this is a problem that has no optimalsolution Entity fields are still incomplete, do not reflect all the data of an object, for example,books have other important information such as edition, old or new, multiple authors, etc.There is no decentralization between the main management and employees, the main managerdoes not need to have data entry functions, but only controls, statistics, and calculates data
2.7.3 Future development direction
In the future, when the database is expanded, creating more roles for users is necessary todevelop the system, some of the target audiences are non-FPT university readers, they are greatpotentials In addition, it is necessary to decentralize management and staff to improve themanagement of the system, to do that, it is necessary to build the necessary entities along withthe appropriate fields for data management such as number of borrowers, number of timesborrowed, favorite books, etc Add book fields like publication date, more authors, readers canborrow more books Upgrade existing database entities to provide more complete objectinformation Finally, optimize data validation so that statistics and data entry become easy andsynchronized
Trang 23In this assignment, a relational database of the library is built based on the detailedrequirements of the users, they have been clearly analyzed about the entities and fields neededfor data management, the functional requirements of the users that are employees and readers After that, a relational database was built to meet those requirements, the data types, primarykeys, foreign keys used were explained in detail about usage and effects To optimize andavoid data redundancy, the normalization from 1NF to 3NF has been carried out andcompleted, data validation helps to format the desired data type for the manager so that the data
in the system becomes synchronous than The physical designs have also been provided indetail The wireframes for the system have also been designed to suit the requirements of theusers who are the readers and the librarians Finally, the advantages and disadvantages weregiven based on the following factors: tools, design methods, and results for users; along withthe direction of future development