Você está na página 1de 9

Technical Training (Oracle DBMS)

Assignment II

Online Library Management System

Student Name
Student ID
Batch BCS3A

Date 25/04/2017
Assignment - 2
Online Library Management System

Fig. Entity Relationship Diagram (ERD) for Online Library Management System
Tables
Table 1 employee

Attribute Description Data type Condition


EID Employee ID Varchar2 Primary Key
FName First Name Varchar2
LName Last Name Varchar2
EAddress Employee Address Varchar2
EJob Job Description Varchar2
Esal Employee Salary Number

Table 2 readers

Attribute Description Data type Condition


RID Reader ID Varchar2 Primary Key
FName First Name Varchar2
LName Last Name Varchar2
RCNo Contact Number Number
RType Reader Type (Paid/Free) Varchar2

Table 3 books

Attribute Description Data type Condition


BID Book ID Varchar2 Primary Key
ISBN ISBN Number
BName Book Name Varchar2
BGenre Book Genre Varchar2
BAuthor Author Varchar2
BPub Publication Varchar2
BType Book Type (Paid/Free) Varchar2
BAvail Availability (Y/N) Varchar2

Table 4 staff

Attribute Description Data type Condition


EID Employee ID Varchar2 Foreign Key (ref employee)
SName Staffs Name Varchar2
Table 5 librarian

Attribute Description Data type Condition


EID Employee ID Varchar2 Foreign Key (ref employee)
LiName Librarians Name Varchar2

Table 6 dba

Attribute Description Data type Condition


EID Employee ID Varchar2 Foreign Key (ref employee)
DName DBAs Name Varchar2

Table 7 freereader

Attribute Description Data type Condition


RID Readers ID Varchar2 Foreign Key (ref readers)
BID Book ID Varchar2 Foreign Key (ref books)
S_O_Trial Start Of Trial Date
E_O_trial End Of Trial Date

Table 8 paidreader

Attribute Description Data type Condition


RID Readers ID Varchar2 Foreign Key (ref readers)
BID Book ID Varchar2 Foreign Key (ref books)
Sub_Rate Subscription Rate Number
I_Date Issue Date Date
R_Date Return Date Date

Table 9 freebook

Attribute Description Data type Condition


BID Book ID Varchar2 Foreign Key (ref books)
RID Readers ID Varchar2 Foreign Key (ref readers)
BQuantity Number Of Books Number
Table 10 paidbook

Attribute Description Data type Condition


BID Book ID Varchar2 Foreign Key (ref books)
RID Readers ID Varchar2 Foreign Key (ref readers)
BPrice Price Of Issuing Number
BQuantity Number Of Books Number

Table 11 authentication

Attribute Description Data type Condition


UserName Username Varchar2 Primary Key
Password Password Varchar2

Notes
1. Employee is further divided into entities staff, librarian and dba, following the
specialization model (top-down design process) as they are distinctive from each other in
the employee set.
Hence these subgroups become lower-level entity sets that have attributes or participate in
relationships that do not apply to the higher-level entity set, i.e., employee.

2. Readers are further divided into entities Free Reader and Paid Reader, following the
specialization model (top-down design process) as they are distinctive from each other in
the employee set.
Hence these subgroups become lower-level entity sets that have attributes or participate in
relationships that do not apply to the higher-level entity set, i.e., readers.

3. Books are further divided into entities Free Book and Paid Book, following the
specialization model (top-down design process) as they are distinctive from each other in
the employee set.
Hence these subgroups become lower-level entity sets that have attributes or participate in
relationships that do not apply to the higher-level entity set, i.e., books.
Oracle SQL Commands
1. Creating Table employee

2. Creating Table readers

3. Creating Table books

4. Creating Table staff

5. Creating Table librarian

6. Creating Table dba

7. Creating Table freereader


8. Creating Table paidreader

9. Creating Table freebook

10. Creating Table paidbook

11. Creating Table authetication

12. Viewing table employee

13. Viewing table readers


14. Viewing table books

15. Viewing table staff

16. Viewing table librarian

17. Viewing table dba

18. Viewing table freereader


19. Viewing table paidreader

20. Viewing table freebook

21. Viewing table paidbook

22. Viewing table authetication

Você também pode gostar