Task1 DBAS

You might also like

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

Table of Contents

Introduction..........................................................................................................................................2
Task1 (Analysis and Design).............................................................................................................4
(a) Introduction, Outline and Initial Analysis......................................................................4
(b) Normalization Process and Creation of ERD..............................................................5
(c) Data Dictionary................................................................................................................8
Task 2 (Implementation)..................................................................................................................13
(a) Create Table..................................................................................................................13
(b) Entering of Sample Data..............................................................................................17
(c) SQL Statement..............................................................................................................23
Task 3 (Assessment and Evaluation).............................................................................................27
Introduction
The paper showcases the knowledge of database system by designing and creating a functional
database application in a particular organization. There are three major parts in this paper. The
first part focuses on analysis and design of the database. This is done by planning the entities
connection so that further actions can be done. The second part is about actual implementation
by creating SQL. Then, assessment and evaluation is done to complete the process. After
finishing the three parts; it is expected to convey a systematic process of database application
development that is useful to apply in a real world.
Task 1
Task1 (Analysis and Design)

(a) Introduction, Outline and Initial Analysis


The study is based on a local library which is located in the downtown area of Yangon City. It is
named as “I.C.E-Youth Library” and it offers different types of services such as book lending,
peer counseling, seminars and workshops, undergraduate study information, language and
academic discussion, community services and job vacancy information. There are wide varieties
of books ranging from novels and comics to education subjects such as management, medicine,
philosophy, English literature and many others. There is a membership system in which
members receive free book lending services.

All processes in library are done in paperwork and hence, it is difficult to know whether a book is
available. It also takes time to track transactions manually. Therefore, database software for
Book Management System is suggested to install. The system will update books inventory,
membership identity and will record every transaction. It will track a book status of being
borrowed or available in a timely manner. It will also provide subscription expire dates. Overall,
the system will hold data about:

 Volunteer
 Upload
 Book
 Category
 BorrowBook
 Borrow
 Members
 Subscription

The transactions that will be managed by the system include:

 Add books information


 Add membership information
 Add subscriptions information
 Add and update volunteer information
 Update membership information
 Update subscriptions information
 Update borrowing process
 Allocate borrowed books information to members and subscription types
 Allocate returned books information to books

Referring to the transactions that the proposed application will perform; it can be seen that
lending services can be done efficiently. It can save time and energy of the staff. The conditions
of the books can also be checked easily. It is more comfortable to control remaining stocks of
books. The system helps tracking the member’s borrowing history so that those who normally
do not return the books in an allocated time can be warned. However, implementing database
can backfire. The frequent electricity cut can be a problem. Unskilled staffs can also make
mistakes and errors when handling the application. However, it can be concluded that
advantages are greater than drawbacks and hence, it is suggested to implement the database
application.

(b) Normalization Process and Creation of ERD


Normalization is the process of eliminating duplicate processes to create effective and efficient
database. First normalization (1NF) is done to remove repeated information. Partial key
dependencies and non-key dependencies are removed in second and third normalization
respectively. The following tables will show full normalization process and respective ERD for
the proposed Book Management System.

Table 1.1 Normalization Table for Book Uploading Process

UNF Level 1NF 2NF 3NF Entity

VolunteerID 1 VolunteerID (PK) VolunteerID (PK) VolunteerID (PK) Volunteer


VolunteerName
VolunteerName 1 VolunteerName VolunteerName
VolunteerEmail
VolunteerEmail 1 VolunteerEmail VolunteerEmail
VolunteerPhNo
VolunteerPhNo 1 VolunteerPhNo VolunteerPhNo

UploadCode 2
VolunteerID (FK)
UploadDate 2 VolunteerID (FK) VolunteerID (FK)
UploadCode (PK)
BookID 2 UploadCode (PK) UploadCode (PK) Upload
UploadDate
BookName 2 BookID UploadDate UploadDate

Author 2 BookName BookID (FK) BookID (FK)

CategoryCode 2 Author

CategoryName 2 CategoryCode BookID (PK) BookID (PK) Book

BorrowDuration 2 CategoryName BookName BookName

BorrowDuration Author Author

CategoryCode CategoryCode (FK)

CategoryName

BorrowDuration CategoryCode (PK) Category

CategoryName

BorrowDuration

Figure 1.1 Entity Relationship Diagram for Book Uploading Process


Table 1.2 Normalization Table for Book Borrowing Process

UNF Level 1NF 2NF 3NF Entity

MemberID 1 MemberID MemberID MemberID (PK) Member

MemberName 1 MemberName MemberName MemberName

MemberEmail 1 MemberEmail MemberEmail MemberEmail

MemberPhNo 1 MemberPhNo MemberPhNo MemberPhNo

SubscriptionTypes 1 SubscriptionTypes SubscriptionTypes SubscriptionTypes(FK)

SubscriptionEndDate 1 SubscriptionEndDate SubscriptionEndDate SubscriptionEndDate

BorrowQty 1 BorrowQty BorrowQty


Duration 1 Duration Duration SubscriptionTypes(PK) Subscription

Fees 1 Fees Fees BorrowQty

BorrowCode 1 BorrowCode(PK) BorrowCode(PK) Duration

BorrowDate 1 BorrowDate BorrowDate Fees

ExpectedReturnDate 2

ReturnDate 2 BorrowCode(FK) BorrowCode(PK) Borrow

BookID 2 ExpectedReturnDate BorrowDate

BookName 2 ReturnDate MemberID(FK)

Author 2 BookID(PK)

CategoryCode 2 BookName BorrowCode(FK) BorrowCode(FK) BorrowBook

CategoryName 2 Author ExpectedReturnDate ExpectedReturnDate

BorrowDuration 2 CategoryCode ReturnDate ReturnDate

CategoryName BookID(FK) BookID(FK)

BorrowDuration

BookID(PK) BookID(PK) Book

BookName BookName

Author Author

CategoryCode CategoryCode(FK)

CategoryName

BorrowDuration CategoryCode(PK) Category

CategoryName

BorrowDuration
Figure 1.2 Entity Relationship Diagram for Book Borrowing Process

Figure 1.3 Entity Relationship Diagram for the Book Management Process

During this process, it is difficult to come up with entities and attributes. There is no prior
experience in creating a database and hence, the determination of leveling for first
normalization takes time. They are solved by thorough researching and seeking consultants
with professionals. The normalization for the whole Book Management System cannot be done
and hence, the system is broken down into two parts for separate normalization.

(c) Data Dictionary


Data dictionary is a guidance for the developers to understand the characteristics of each
attribute that is included in the database creation. All entities that are identified in the
normalization tables are needed to do data dictionary for the purpose of determining data type,
length, constraint and description. The following tables represent the data dictionary of each
entity as a reference in implementing the database software.

Entity: Volunteer

Primary Key: VolunteerID

Foreign Key: -

Attribute Name Data Type Length Constraint Description

VolunteerID Varchar 6 Primary Key Unique for every volunteer.

VolunteerName Varchar 30 - The name of volunteer.

VolunteerEmail Varchar 20 - Email address of volunteer.

VolunteerPhNo Int - - Phone number of


volunteer.

Entity: Category

Primary Key: CateoryCode

Foreign Key: -

Attribute Name Data Type Length Constraint Description

CategoryCode Varchar 6 Primary Key Unique for every type of


category.
CategoryName Varchar 10 - One of the three categories
of a library.

BorrowDuration Varchar 15 - Maximum borrowing time


that is unique for each
category.

Entity: Subscription

Primary Key: SubscriptionTypes

Foreign Key: -

Attribute Name Data Type Length Constraint Description

SubscriptionTypes Varchar 10 Primary Key One of the three subscription


types of a library.

BorrowQty Int - - Maximum borrowed books for


each subscription.

Duration Varchar 10 - Effective duration of member.

Fees Int - - Amount of membership fees.

Entity: Book

Primary Key: BookID

Foreign Key: CategoryCode

Attribute Name Data Type Length Constraint Description

BookID Varchar 6 Primary Key Unique for every book.

BookName Varchar 50 - The name of book.

Author Varchar 30 - Writer of the book.


CategoryCode Varchar 6 Foreign Key Unique for every type of
category.

Entity: Member

Primary Key: MemberID

Foreign Key: SubscriptionTypes

Attribute Name Data Type Length Constraint Description

MemberID Varchar 6 Primary Key Unique for each member.

MemberName Varchar 30 - The name of member.

MemberEmail Varchar 20 - Email address of member.

MemberPhNo Int - Phone number of member.

SubscriptionTypes Varchar 10 Foreign Key One of the two


subscription types of a
library.

SubscriptionEndDate Datetime - - Expire date of


membership.

Entity: Borrow

Primary Key: BorrowCode

Foreign Key: MemberID

Attribute Name Data Type Length Constraint Description

BorrowCode Varchar 6 Primary Key Unique for each transaction.


BorrowDate Datetime - - The date of transaction.

MemberID Varchar 6 Foreign Key Unique for each member.

Entity: Upload

Primary Key: UploadCode

Foreign Key: VolunteerID, BookID

Attribute Name Data Type Length Constraint Description

VolunteerID Varchar 6 Foreign Key Unique for every


volunteer.

UploadCode Varchar 6 Primary Key Unique for every upload.

UploadDate Datetime - The date of upload.

BookID Varchar 6 Foreign Key Unique for every book.

Entity: BorrowBook

Primary Key:-

Foreign Key: BorrowCode, BookID

Attribute Name Data Type Length Constraint Description

BorrowCode Varchar 6 Foreign Key Unique for each


transaction.

ExpectedReturnDate Datetime - - Latest return date of the


borrowed book.

ReturnDate Datetime - - Actual return date by the


member.

BookID Varchar 6 Foreign Key Unique for every book.

You might also like