You are on page 1of 16

By: Kumar Rishab HPES Oracle Summer Training 2012

Project Description

Scope of the Project


Entities or Object ER Diagram Constraint & Checks Report on Normal forms Sample queries

Purpose: The purpose of this application

are as follows: The software is for automation of library. It provides following facilities to Operator : Can enter details related to a particular book. Can provide membership to student.

Admin : Can read and write information about any student. Can update, create, and delete the record of student as per requirement and implementation plans.
Assumptions: Customized data will be used in this application.

User does not have right to enter information


about books.

This application can be easily implemented

under various situations. SOFTWARE SCOPE: Extensibility: This software is extendable in ways that its original developers may not expect. The following principles enhances extensibility like hide data structure, avoid traversing multiple links or methods, avoid case statements on object type and distinguish public and private operations.

Reusability: Reusability is possible as and when

require in this application. We can update it next version. Reusable software reduces design, coding and testing cost by amortizing effort over several designs. Reducing the amount of code also simplifies understanding, which increases the likelihood that the code is correct. We follow up both types of reusability: Sharing of newly written code within a project and reuse of previously written code on new projects.

Understandability: A method is understandable if

someone other than the creator of the method can understand the code (as well as the creator after a time lapse). We use the method,which small and coherent helps to accomplish this. Cost-effectiveness: Its cost is under the budget and make within given time period. It is desirable to aim for a system with a minimum cost subject to the condition that it must satisfy the entire requirement. Scope: Scope of this document is to put down the requirements, clearly identifying the information needed by the user, the source of the information and outputs expected from the system.

Entities
Students
Books Status of retun Services Status of return

Attributes
student_id, first_name, last_name, dob, contact no,library id.
book_id, book name, edition, publisher,author,no of copies. Issue date,library id,book name ,book id Fine,issue,return

return date,library id,book name ,book id

Book Name Book id

Lib id

Date of Issue

Status of issue

PRIMARY KEY CONSTRAINT In this database entities contain some attributes with primary

key constraints. From the student table student_id, book_id from books. FOREIGN KEY CONSTRAINTForeign key of parent table work as a primary key of child table. NOT NULL CONSTRAINTNot null constraint does not contain null values. It is used to show the value of column cant be null. Example-The value of student name and book name cant be null. UNIQUE CONSTRAINT Unique constraint ensures that the entries in the column is unique. Ex Library id must be unique for every student .

Form new relation for each multivalued attribute or nested attribute. FIRST NORMAL FORM (1NF) :

TEST Relation should have no multivalued attributes or nested relations. Normalization

Or
Remove the attribute that violates the 1NF and place it in a separate relation. Number of books issued,returned consists of a set of values, so it violates the

1NF. Therefore, Status of issue,return are separated as an entity. SECOND NORMAL FORM (2NF) :

SECOND NORMAL FORM (2NF) : TEST For relations where primary key contains multiple

attributes, no nonkey attribute should be functionally dependent on a part of primary key.

Normalization Decompose and set up a new relationship for each partial

key with its dependent attribute(s). Make sure to keep a relation with the original primary key and any attributes which are fully functionally dependent on it.

THIRD NORMAL FORM (3NF) : TEST Relation should not have a nonkey attribute functionally

determined by another nonkey attribute i.e. there should be no transitive dependency of a nonkey attribute on the primary key.

Normalisation Decompose and set up a relation that includes the nonkey

attribute that functionally determines other attributes.

for user creation: Create user emp identified by emp; for privileges: Grant select, insert, update on books, student to emp;

Create tables Create table student(student_id number(5),first_name varchar2(20) ,last_name varchar2(20),contact number(10),dob date,library id number(10)) Create table books(book_id number(5),bookname varchar2(20) ,author varchar2(20),edition number(10),publisher varchar2(20)) Create table status of issue(book_id number(5),bookname varchar2(20),library id number(10)date of issue date)

Create table status of return(book_id number(5),bookname varchar2(20),library id number(10) date of return date)

for selecting student with their information: select * from student ; for selecting all the student with the information who have issued the book from the library select s.first_name as name, s.contact no,d.date of issue from student s, date of issue d where s.student id = d.student id; for select all books which have been issued: select b.book id,book name from from books b,status of issue i

where b.book id=i.book id;


for selecting all details of the student who have not returned the book in given time: select s.student id,s.student name from student s,status of issue i,status of return r, where (sysdate-issue date)>(return date-issue date);

TRIGGERS APPLIED:

When the number of copies of a particular book gets

issued it will call a trigger that no book is left for issuing.


Student can only issue a book if he has a valid student

id,library id valid for a limited period

You might also like