You are on page 1of 16

Project Report on

The System Of Borrowing Books From


Library

Submitted in Partial Fulfillment


For the Award of

DATABASE MANAGEMENT SYSTEM (CS_404)

Computer University (Magway)

Group (III)
March- 2017
Guided by : Dr. Theint Theint Aye

Presented by

Ma Aye Nandar Myo 4CS - 43


Ma Thet Htar Hlaing 4CS - 51
Ma Honey Htay Lwin 4CS - 59
Ma Wai Wai Hnin 4CS - 67
Ma May Hpoo Wint Zay Oo 4CS - 75
Mg Chae Maung Maung 4CS - 83
ACKNOWLEDGEMENT

We would like to acknowledge Dr. Soe Lin Aung. Principal of the


Computer University (Magway).
We are extremely grateful to Dr. Theint Theint Aye, Research and
Development Department, for this valuable guidance, suggestions, patience and
encouragement during this period of not only in lecture time but also in this
project time. We are also thankful to Dr. Zarchi Su SuHlaing from Research
and Development Department for her valuable lab lectures.
We would like to thank Daw Ei Ei Moe Htun from Information Science
Department, Daw Chaw Su Hlaing from English Department and all of our
teachers, friends and staff in Computer University (Magway) for their valuable
and helpful suggestions, supports and contribution to the accomplishment of
this project.
Contents
No. Descriptions Page No
1 Project Description 1
2 Objective of the Project 2
3 Implementation of the Project 3
3.1 Creating Database 3
3.2 Database Design 3
3.3 Creating Tables 4
3.4 Inserting Data 5
3.5 Identifying Users 7
3.6 Defining Views and Privileges 7
3.7 Creating Views and Triggers 7
4 Conclusion 11
5 Reference 12
LIST OF TABLES
No. Table Description
3.1 Book Table
3.2 Member Table
3.3 Student Table
3.4 Teacher Table
3.5 TransitionTable
1

The System Of Borrowing Books From Library


1. Project Description
The project DBMS name is The System Of Borrowing Books From
Library. It includes three tables. These are Book_List, Record, Card_Info. The
book_list table includes Bcode, Bname, AuthName, Permission, Duration,
Publisher, Edition, Bvalue, No_of_copy. Card_Info table has Cno, Name, Type,
Department, RollNo, PhNo, Address, Cdate, BCount. Record table has Rno,
Cno, Bcode, Bdate, Idate, Rdate, Rnote, CDate.

The library contains books and members which must be organized in


order to prevent chaos. As our technology improves, we start to see more and
more the enormous amount of help which we can receive from
computers. Therefore, we start to create this project to computerize the whole
library system to be simple and effective.
2
2. Objectives of the Project
The objectives of the project are:
 To eliminate the paper-work in library
 To record every transaction with accurate data and time in computerized
system so that problem such as record file errors won't happen again
 To allow user to keep track the lost book and member renting history
 To reduce the cost of time for searching, recording, updating and
deleting data
 To complete the system according to project schedule
3
3. Implementation of the project
The system is implemented on MySQL Sever 5.1.

3.1 Creating Database


Database Name: groupiii_library

3.2 Database Design


The database design is as follow:

3.3 Creating Tables


There are five tables in Library System Database. The tables are as
follows:
• Book_List
• Card_Info
• Record
The Book_List table is created as follows:
Table(3.3.1) Book_List Table

Attribute Type Format/Range Required PK/ FK


FK References
Rno Varchar Yes PK

CNo Varchar Yes FK Card_Info

Bcode Varchar Yes FK Book_List

Bdate Date yy-mm-dd Yes

Idate Date yy-mm-dd Yes

RDate Date yy-mm-dd Yes

RNote Varchar Yes

CDate Date yy-mm-dd Yes

Card_Info table is created as follows:


Table (3.3.2)Card_Info Table

Attribute Type Format/Range Required PK/ Definition


FK

CNo Numeric Yes PK Card Number

Name Varchar Yes Borrower Name

Type Varchar Yes Borrower Type


Department Varchar Yes Department

RollNo Varchar Yes Roll No

PhNo Varchar Yes Ph No

Address Varchar Yes Address

CDate Date Yes Card Date

Bcount Numeric Yes No of books

Record Table is created as follows:


Table (3.3.3) Record Table

Attribute Type Format/Range Required PK/ FK


FK References
Rno Varchar Yes PK

CNo Varchar Yes FK Card_Info

Bcode Varchar Yes FK Book_List

Bdate Date yy-mm-dd Yes

Idate Date yy-mm-dd Yes

RDate Date yy-mm-dd Yes

RNote Varchar Yes

CDate Date yy-mm-dd Yes

3.4 Inserting Data


The data for Book_List Table are inserted as follows:
Insert into Book_List
values('B1','China','Chit San Win',' ',7,'PanmyotayarSarpai','1st',4000,3);
Table 3.3.1 Book_List Table
Bcode Bname Auth Permission Duratio Producer Edition Bvalu No_of
Name n e _Copy
B1 China Chit 7 Panmyota 1st 4000 3
San yar
Win Sarpai
B2 Myan Hla 7 Pyinnyar 1st 3200 4
Tine Moe Shwe
Htar Ni Taung

The data for Card_Info Table are inserted as follows:


Insert into Card_Info
values(‘C1’, ‘Ma Mya Thin Khaing’, ‘Student’,’ ‘,’3CS_9’,09-256486110’,
’Kan Thar(B) Thit Sar Road’,’2017/2/19’);
Table 3.3.2 Card_Info Table
Cno Name Type Department RollNo PhNo Address CDate Bcount
C1 Ma Student 3CS_9 09- Kan 2017/2 1
Mya 2564861 Thar(B) /19
Thin 10 Thit Sar
Khain Road
g
C2 Ma Yi Student 4CS_69 09- Khwar 2017/1 1
Mon 4501935 Nyo(13) /21
Thant 00 Street

The data for Record Table are inserted as follows:


Insert into Record
values(‘R1’,‘C2',‘B16', ‘2017/1/21', ‘2017/1/28‘, ‘0000/0/0’, ‘ ‘)
Table 3.3.3 Record Table
Rno Cno Bcode Bdate Idate Rdate Rnote Cdate
R1 C2 B16 2017/1/21 2017/1/28 0000/00/00 2017/2/19
R2 C5 B35 2017/2/10 2017/2/12 0000/00/00 2017/1/21

7
3.5 Identifying Users
According to the system provide, three type of users:
Libstaffone, libstafftwo, member
 Create user libstaffone@localhost identified by 'cumgylibone';
 Create user libstafftwo@localhost IDENTIFY BY ‘cumgylibtwo’;
 Create user member@localhost IDENTIFY BY ‘cumgylibmem’;
3.6 Defining Privileges
1. libstaffone: As a admin, to access all tables and manage the system
2. libstafftwo: To access Record and Card_Info in selecting, inserting and
Updating
3. member: To access Book_Information in selecting

3.7 Creating Views and Triggers


3.7.1 Creating views
Create view Book_Information As
Select Book_List.Bname, Book_List.AuthName, Book_List.Permission,
Book_List.Duration
From Book_List;

3.7.2 Creating Triggers


Trigger for inserting data into Member table
Create trigger typecheck
before insert
on Member
for each row
begin
ifnew.type=‘Student’ then
setnew.type=‘Student’;
elseifnew.type=‘Teacher’ then
setnew.type=‘Teacher’;
else
setnew.type=‘Invalid’;
end if;
end;

Trigger for inserting data into Student table


Create trigger classcheck
before insert
on Student
for each row
begin
ifnew.class=‘1st Year’ then
setnew.class=class;
elseifnew.class=‘2nd Year’ then
setnew.class=class;
elseifnew.class=‘3rd Year’ then
setnew.class=class;
elseifnew.class=‘4th Year’ then
setnew.class=class;
9
elseifnew.class=‘5th Year’ then
setnew.class=class;
else
setnew.class=‘Invalid’;
end if;
end;

Trigger for inserting data into Teacher table


Create trigger teachercheck
before insert
for each row
begin
ifnew.gender=‘Male’ then
setnew.gender=gender;
elseifnew.gender=‘Female’ then
setnew.gender=gender;
else
setnew.gender=‘Invalid’;
end if;
ifnew.dept=‘Myanmar’ or
new.dept=‘English’ or
new.dept=‘Physics’ or
new.dept=‘Maths’ or

new.dept=‘Software’ or
new.dept=‘Hardware’ or
new.dept=‘Information Science’ or
new.dept=‘Application’ or
new.dept=‘Research’ then
setnew.dept=dept;
10
else
setnew.dept=‘Invalid’;
end if;
end;
Trigger for inserting data into Transition table
Create trigger datecheck
before insert
on Transition
for each row
begin
ifnew.rdate<new.ldate then
signalsqlstate ‘45000’
setmessage_text=‘Invalid date’;
end if;
end;

Trigger for checking number of book copy in Book Table


Create trigger copycheck
Before insert
on Book
for each row
Begin
if new.no_of_copy<1 then
signalsqlstate ‘45000’
setmessage_text=‘No of copy must be greater than 0’;
end if;
end;

11
4. Conclusion
The System Of Borrowing Books From Library allows to the users to
store the book details, member detalils and the records details with accurate
data and time. This system also provides authentication so that unauthorized
person is not able to gain access into database. And then, it can reduce the cost
of time and the record errors compare with paper work and can easily search
the information which authorized users want, in a short time.
12
5. REFERENCE
C.J.Date, “An Introduction to Database Management System”,
the 7th Edition

You might also like