Assignment 1 Database

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

ASSIGNMENT 1 FRONT SHEET

Qualification TEC Level 5 HND Diploma in Computing

Unit number and title Unit 04: Database Design & Development

Submission date 11/08/2020 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Phan Anh Ly Ly Student ID GCD191295

Class 1622 – GCD0806 Assessor name Srikanth Raju Kandukuri

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 LyLy

Grading grid

P1 M1 D1
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:
Table of Contents
I. PROBLEM STATEMENT........................................................................................................................5
1.1 Scenario:......................................................................................................................................5
1.2 Report objectives:........................................................................................................................5
II. DATABASE DESIGN...............................................................................................................................6
2.1 The scenario of the chosen system:.............................................................................................6
2.2 System Requirement Specification:.............................................................................................7
2.3 Logical design(ERD):.....................................................................................................................8
2.4 Explanation:.................................................................................................................................9
2.5 Physical design...........................................................................................................................11
2.5.1 Table USER_ONL................................................................................................................11
2.5.2 Table BOOK_LIRARY...........................................................................................................11
2.5.3 Table BOOK_BORROW.......................................................................................................11
2.5.4 Table AUTHOR...................................................................................................................12
2.5.5 Table BOOK_CATEGORY.....................................................................................................12
2.5.6 Table ADMIN......................................................................................................................12
INDEX OF COMMENTS...............................................................................................................................13
Table of Figure
Figure 1: Diagram of Online Library system.................................................................................................8
Figure 2: USER_ONL.....................................................................................................................................9
Figure 3: BOOK_BORROW...........................................................................................................................9
Figure 4: BOOK_LIBRARY...........................................................................................................................10
Figure 5: AUTHOR......................................................................................................................................10
Figure 6: BOOK_CATEGORY.......................................................................................................................10

Table of Table
Table 1: System Requirement Specification................................................................................................7
Table 2: Table USER_ONL..........................................................................................................................11
Table 3: Table BOOK_LIBRARY...................................................................................................................11
Table 4: Table BOOK_BORROW.................................................................................................................11
Table 6: Table AUTHOR.............................................................................................................................12
Table 7: Table BOOK_CATEGORY...............................................................................................................12
Table 8: Table ADMIN................................................................................................................................12
I. PROBLEM STATEMENT

1.1 Scenario:
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.

1.2 Report objectives:

My SQL code use for making table or design some display table after user/admin
using some of their permission and for my choice that making an Online Library system, I
want to focus on manage book the most. The data of each book will link to other data on
another table for display all data which user, librarian or admin need, each permission,
each data table for them.
II. DATABASE DESIGN

2.1 The scenario of the chosen system:

o I chose to build an Online library system:


 My job is create and develop the database system for the FPT University
Online Library system.
 I want to build an Online library system which can be used easily by user and
manage remotely.
 For example: people who have an account logged into the system can borrow
books while at home or check the date of returning books to the library, they
need not to go out during epidemic outbreaks, everyone can make orders and
post to the system and admin will confirm and ship the book to their address
and the shipper will call they to receive the book or get the book to return
library.
 For design: I focus to database on system and make it look simple, easy to use
for every user.

o This system will include databases of User, Book, Admin, Book borrow.
2.2 System Requirement Specification:

Base name Brief description User story


Admin can As an Admin:
Admin_Permissions_Book add/update/remove I want to have Permissions to
s Books on Online library add/update/remove books for
system refreshing data.
As an Admin:
Admin can search User I want to know history on system,
Admin_Search_User
by school ID who borrow book and who have
return book to library
As an Admin:
Admin can view detail in I want to access profile data of user
Admin_View_User_Detail
user account to remember, to take a note maybe
for the gift of event.
As an Admin:
Admin can change I want to change password if user
Admin_Change_Password password of user’s forgot their password, they can
account give me school id and I can reset
their password
User can register As an User:
User_ Register themselves with account I want to register my account on
and password system by myself
User can As an User:
User_Profile view/change/update I want to change my profile as
their profile phone number, address.
As an User:
User can preview book
User_Preview_Book I want to preview book before I
on system but it not full
borrow it
As an User:
I want to register online at home, I
Users can register to just went to library and show my
User_Borrow_Book
borrow books online application form on my phone and
I can take it, it not spends too much
time to fill into application form.
As an User:
Users can change their
User_Change_Password I want to have permission to
password
changer my password.
As an User:
User can recover their I can contact with admin and give
User_Recover_Password
password if they forget it them my information to recover
my password.
Table 1: System Requirement Specification.

2.3 Logical design(ERD):

Figure 1: Diagram of Online Library system.

 Primary Key:

 USER_ACC of table USER_ONL.


 BORROW_ID of table BOOK_BORROW.
 BOOK_ID of table BOOK_LIBRARY.
 CATEGORY of table BOOK_CETEGORY.
 AUTHOR_NAME of table AUTHOR.
 ADMIN_NAME of table ADMIN.

 Foreign Key:

 USER_ACC is foreign key of table BOOK_BORROW from table USER_ONL.


 BOOK_ID is foreign key of table BOOK_BORROW from table BOOK_LIBRARY.
 AUTHOR_NAME is foreign key of table BOOK_LIBRARY from table AUTHOR.
 CATEGORY is foreign key of table BOOK_LIBRARY from table BOOK_CATEGORY.
2.4 Explanation:

1.1 Table USER_ONL (USER_ACC,


USER_PASS, FIRST_NAME,
LAST_NAME, DATE_OF_BIRTH,
SCHOOL_ID, PHONE_NUM,
ADDRESS)
1.2 This table have all information
of user when they register in system,
user can change or update after
register, it will save on system Admin

Figure 2: USER_ONL.

Table BOOK_BORROW (BORROW_ID,


USER_ACC, FIRST_NAME, LAST_NAME,
BOOK_ID, BOOK_NAME,
DATE_BORROW, DATE_RETURN)
This table contain the borrow data
about book, user and time, it helps
admin manage the time user borrow
and return book.
This data show status about the
book then admin can update info on
system.

Figure 3: BOOK_BORROW.
Table BOOK_LIBRARY (BOOK_ID,
BOOK_NAME, AUTHOR_NAME,
CATERORY)
This table is contain all info of
book in library
This data will help admin manage
book in library and help user to
search book they want to find.

Figure 4: BOOK_LIBRARY.

Table AUTHOR (AUTHOR_NAME)


This table have data of author when
books have same name user can check the
author to make sure their choice is true
Figure 5: AUTHOR.

Table BOOK_CATEGORY (CATEGORY)


This table have data of category user
can find the right category for them.

Figure 6: BOOK_CATEGORY.
2.5 Physical design

2.5.1 Table USER_ONL


Column Data type Note
USER_ACC varchar(20) NOT NULL, primary key
USER_PASS varchar(20) NOT NULL
FIRST_NAME varchar(50) NOT NULL
LAST_NAME varchar(50) NOT NULL
DATE_OF_BIRTH timestamp NOT NULL
SCHOOL_ID varchar(20) NOT NULL
PHONE_NUM int
ADDRESS varchar(50) NOT NULL

Table 2: Table USER_ONL.

2.5.2 Table BOOK_LIRARY


Column Data type Note
BOOK_ID varchar(20) NOT NULL, primary key
BOOK_NAME varchar(50) NOT NULL
AUTHOR_NAME varchar(50) NOT NULL, foreign key
CATEGORY varchar(100) NOT NULL, foreign key

Table 3: Table BOOK_LIBRARY.

2.5.3 Table BOOK_BORROW


Column Data type Note
BORROW_ID INT NOT NULL UNIQUE AUTO
INCREMENT, primary key
USER_ACC varchar(20) NOT NULL, foreign key
FIRST_NAME varchar(50) NOT NULL
LAST_NAME varchar(50) NOT NULL
BOOK_ID varchar(20) NOT NULL, foreign key
BOOK_NAME varchar(50) NOT NULL
DATE_BORROW timestamp
DATE_RETURN timestamp NOT NULL

Table 4: Table BOOK_BORROW.


2.5.4 Table AUTHOR
Column Data type Note
AUTHOR_NAME varchar(50) NOT NULL, primary key

Table 5: Table AUTHOR.

2.5.5 Table BOOK_CATEGORY


Column Data type Note
CATEGORY varchar(100) NOT NULL, primary key

Table 6: Table BOOK_CATEGORY.

2.5.6 Table ADMIN


Column Data type Note
ADMIN_ACC varchar(20) NOT NULL
ADMIN_PASS varchar(20) NOT NULL
ADMIN_NAME varchar(50) NOT NULL, primary key

Table 7: Table ADMIN.


INDEX OF COMMENTS

...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................

You might also like