0% found this document useful (0 votes)
40 views

Online Bookstore: Group 1

The document describes an online bookstore database system with submodules/tables for books, authors, publishers, customers, suppliers, and relationships between them. It lists functionalities like maintaining inventory, customer accounts, shopping cart, checkout, member promotions, transaction logging, and reordering books. Schemas are provided to define the tables for each submodule and their attributes and relationships.

Uploaded by

sambradshaw945
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Online Bookstore: Group 1

The document describes an online bookstore database system with submodules/tables for books, authors, publishers, customers, suppliers, and relationships between them. It lists functionalities like maintaining inventory, customer accounts, shopping cart, checkout, member promotions, transaction logging, and reordering books. Schemas are provided to define the tables for each submodule and their attributes and relationships.

Uploaded by

sambradshaw945
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ONLINE BOOKSTORE

GROUP 1
SOHAM DAN 12CS10059
HARITABH SINGH 12CS10023
DHRUV JAIN 12CS30043
ASEEM PATNI 12CS10008

SUB-MODULES
Sub Module Schema / Attributes

Books ISBN_no
Language
Dimension
Pages
Cover
Ranking
Price

Author author_id
Name
Description

Publisher Pub_id
Name

Customer C_id
Name
E_mail
Phone Number
Password

Supplier supplier_id
Name
Rating
Relations between submodules

published_by {
ISBN_no
pub_id
}

authored_by {
ISBN_no
author_id
}

supplied_by {
ISBN_no
supplier_id
}

reviews {
ISBN_no
customer_id
data
review_text
rating
}

buys {
data
discount
quantity
}

similar {
ISBN_no_1
ISBN_no_2
}
FUNCTIONALITIES SUPPORTED /
QUERIES HANDLED :
● Maintain data associated with the inventory (a collection of books)
•A book has a title, author and price
•The inventory also keep track of the stock/quantity of each book
•Maintain records for many customers
•A customer can be either a member or non-member.
•A customer has a username (unique across all users), password (no
restrictions), email address (no restrictions), and postal address
(unverified.)
•Anyone may sign up for a customer account.
•Allow any customer to become a member.
•Show a listing of available books
Books are to be displayed in ascending alphabetical order by title.
•Each book will list the following from left to right
•Title
•Author
•Price
•Allow customers and managers to log in and out of the system.
•Users (both customers and the manager) will be logged out if inactive for
30 minutes.
•Shopping cart
•Anyone is able to add one or more books to the shopping cart.
•The shopping cart does not need to allow multiple copies of any book.
•Checkout
•Checkout is only available to logged-in customers. A user that is not
logged in as a customer is given a chance to log in.
•Member customers may enter a promotion code.
•Only one promotion code may be used per purchase
•The promotion is a fixed percentage discount that is to be applied to an
entire order.
•The discount is specified by the manager at the time of the promotion’s
creation or most recent update/edit.
•Collect a 16-digit credit card number from the customer
•Log/record the transaction
•Allow manager to specify a stop-order for a book
•Each book has its own stop-order status–either on or off. Details of its use
are involved in the following feature.
•Notify manager when books need to be reordered
•When the quantity a book falls below a threshold, the manager is notified
that the book needs to be reordered.
•One exception is if the manager has already specified a stop-order for this
book.
•Every book must either have stop-order enabled or disabled
•Allow manager to update stock quantities
•Allow manager to change any book's price
•Allow manager to view transaction logs
•Allow manager to create promotions
•A promotion is a percentage discount that can be applied to an entire
order
•Promotions may only be used by member customers
•A promotion has an expiration date specified by the manager
When a promotion is created, it is emailed to all member customers via the
email address on record.

SCHEMAS
CREATE TABLE AUTHOR ( AUTHOR_ID VARCHAR (200), NAME
VARCHAR (200), CONSTRAINT pk_author_id PRIMARY KEY
(AUTHOR_ID));

CREATE TABLE SUPPLIER ( SUP_ID VARCHAR (200), NAME


VARCHAR (200), RATING NUMERIC (3,1), CONSTRAINT pk_sup_id
PRIMARY KEY (SUP_ID), CONSTRAINT chk_supplier_rating CHECK
(RATING <= 10.0 and RATING >= 0.0));
CREATE TABLE PUBLISHER ( PUB_ID VARCHAR (200), NAME
VARCHAR (200), CONSTRAINT pk_pub_id PRIMARY KEY (PUB_ID));

CREATE TABLE BOOKS ( ISBN VARCHAR (200), LANGUAGE


VARCHAR (200), DIMENSION VARCHAR (200), PAGES INTEGER,
COVER VARCHAR (200), RANKING INTEGER, PRICE FLOAT,
CONSTRAINT pk_isbn PRIMARY KEY (ISBN));

CREATE TABLE SIMILAR (ISBN_1 VARCHAR (200), ISBN_2 VARCHAR


(200), CONSTRAINT pk_similar PRIMARY KEY (ISBN_1,ISBN_2),
CONSTRAINT fk_similar_isbn_1 FOREIGN KEY (ISBN_1) REFERENCES
BOOKS (ISBN), CONSTRAINT fk_similar_isbn_2 FOREIGN KEY
(ISBN_2) REFERENCES BOOKS (ISBN));

CREATE TABLE SUPPLY (ISBN VARCHAR (200), SUP_ID VARCHAR


(200), IN_OUT_STOCK CHAR(1), CONSTRAINT pk_supply PRIMARY
KEY (ISBN,SUP_ID), CONSTRAINT fk_supply_isbn FOREIGN KEY
(ISBN) REFERENCES BOOKS (ISBN), CONSTRAINT fk_supply_sup_id
FOREIGN KEY (SUP_ID) REFERENCES SUPPLIER (SUP_ID),
CONSTRAINT chk_in_out_stock CHECK (IN_OUT_STOCK IN ('Y','N')));

CREATE TABLE AUTHORED_BY (ISBN VARCHAR (200), AUTHOR_ID


VARCHAR (200), CONSTRAINT pk_authored_by PRIMARY KEY
(ISBN,AUTHOR_ID), CONSTRAINT fk_authored_by_isbn FOREIGN KEY
(ISBN) REFERENCES BOOKS (ISBN), CONSTRAINT
fk_authored_by_author_id FOREIGN KEY (AUTHOR_ID) REFERENCES
AUTHOR (AUTHOR_ID));

CREATE TABLE PUBLISHED_BY (ISBN VARCHAR (200), PUB_ID


VARCHAR (200), CONSTRAINT pk_published_by PRIMARY KEY
(ISBN,PUB_ID), CONSTRAINT fk_published_by_isbn FOREIGN KEY
(ISBN) REFERENCES BOOKS (ISBN), CONSTRAINT
pk_published_by_pub_id FOREIGN KEY (PUB_ID) REFERENCES
PUBLISHER (PUB_ID));
CREATE TABLE BS_CUSTOMER (CUSTOMER_ID VARCHAR (200),
NAME VARCHAR (200), E_MAIL VARCHAR (200), PHONE_NUMBER
INTEGER, PASSWORD VARCHAR (200), CONSTRAINT pk_cusotmer_id
PRIMARY KEY (CUSTOMER_ID));

CREATE TABLE REVIEW (CUSTOMER_ID VARCHAR (200), ISBN


VARCHAR (200), DATE DATE, REVIEW_TEXT VARCHAR (500), RATING
NUMERIC(3,1), CONSTRAINT pk_review PRIMARY KEY
(CUSTOMER_ID,ISBN), CONSTRAINT fk_review_customer_id FOREIGN
KEY (CUSTOMER_ID) REFERENCES CUSTOMER (CUSTOMER_ID),
CONSTRAINT fk_review_isbn FOREIGN KEY (ISBN) REFERENCES
BOOKS (ISBN), CONSTRAINT chk_review_rating CHECK (RATING >=
0.0 and RATING <= 10.0));

CREATE TABLE BUYS (CUSTOMER_ID VARCHAR (200), ISBN


VARCHAR (200), DATE DATE, COUNT INTEGER, CONSTRAINT
pk_buys PRIMARY KEY (CUSTOMER_ID,ISBN,DATE,COUNT),
CONSTRAINT fk_buys_customer_id FOREIGN KEY (CUSTOMER_ID)
REFERENCES CUSTOMER (CUSTOMER_ID), CONSTRAINT
fk_buys_isbn FOREIGN KEY (ISBN) REFERENCES BOOKS (ISBN));

You might also like