Professional Documents
Culture Documents
Section-1
Project Description
Book Store Information System
This system is about the information of an individual book store. The system
has basically three tables ( Employee, Books, BookSales). All the information of
books is stored in Books table. Employee table has all the information of employee
and BookSales table contains book sales information. The system has three general
users: Manager, Marketing_Manager and Salesperson. Manager has all privileges
on all tables. Marketing_Manager has all privileges on Books and retrieve
privilege on BookSales table and order books of those quantities less than or equal
to 5. Salesperson has retrieve and insert privileges on BookSales Table. Book sales
log are done by creating triggers and also for the changed prices of the books.
2 | Page
Section 2
Database Design
Employee
Emp_id
Emp_name
Emp_dob
Emp_address
Emp_phno
Position
Salary
Char(6)
Char(20)
Date
Char(50)
Int
Char(20)
Decimal
PK
Not Null
Char(5)
Char(30)
Char(30)
Int
Char(20)
Decimal
Int
PK
Not Null
Char(5)
Char(6)
Int
Decimal
FK
FK
Not Null
Not Null
Books
Book_id
Book_name
Author
Pub_Yr
Category
Price
Qty
BookSales
Book_id
Emp_id
SalesQty
TotalPrice
3 | Page
Section 3
Integrity Constraints
1. Every primary key and foreign keys pairs are integrity constraints for this
system.
2. Emp_id has to be like first three characters would have to be EMP, and then
followed by integers ranging from 1 to 999.
Type Emp_id POSSREP (Char) Constraint
Substr( The_Emp_id (Emp_id),1,3) = EMP and
Cast_As_Integer (Substr (The_Emp_id (Emp_id),4) > 0) and
Cast_As_Integer (Substr (The_Emp_id (Emp_id),4) 999);
3. Book_id has to be like first character would have to be B, and then followed
by integers ranging from 1 to 9999.
Type Book_id POSSREP (Char) Constraint
Substr( The_Book_id (Book_id),1,1) = B and
Cast_As_Integer (Substr (The_Book_id (Book_id),2) > 0) and
Cast_As_Integer (Substr (The_Book_id (Book_id),2) 9999);
4. Only legal values for Category field are: Humor, Thriller, Romance, Science
Fiction, Arts, Business, Children, Computers & Technology, Cooking, Health,
History, Politics, Sports, Travel.
Type Category POSSREP (Char) Constraint
The_Category (Category) = Humor OR
The_Category (Category) = Thriller OR
The_Category (Category) = Romance OR
The_Category (Category) = Science Fiction OR
The_Category (Category) = Arts OR
The_Category (Category) = Business OR
The_Category (Category) = Children OR
The_Category (Category) = Computers & Technology OR
The_Category (Category) = History OR
The_Category (Category) = Politics OR
The_Category (Category) = Sports OR
The_Category (Category) = Travel;
5. The Salesperson has to check that the book quantity that has to be sold must
be less than or equal to available quantity.
Section 4
Security Constraints
4 | Page
Section 5
Trigger Procedure
Recording of book sales log can be done by a trigger.
5 | Page