DBMS LAB Assign. 1
DBMS LAB Assign. 1
PRN: 19070122124
Class: CS - B3
DBMS LAB
ASSIGNMENT -1
Convert every weak entity set into a table where we take the
discrimination attribute of the weak entity set and takes the primary key
of the strong entity set as a foreign key and then declared the
combination of discriminator attribute and foreign key as a primary key.
For a 1:1 Relationship between two entities S and T. Choose one of the
relations, Example - S and include as foreign key in S the primary key of
T. It is better to choose on entity total participation on S and include
descriptive attribute.
For 1:N relationship identify the entity on S and N side of the
relationship. Include a foreign key in S the Primary key of relation T also
include Discipline attributes of 1:N attribute of S.
For each M:N relationship create a new relational table include in the
new relation ,the primary key of the participating entities as a well as
descriptive attributes. The primary key of the table will be the
combination of primary keys of participating entities.
For every multi-valued attribute will make a new table where we will
take primary key of main table as a foreign key and multi-valued
attribute as a primary key.
IMPLEMENTATION QUESTIONS:
RELATIONAL SCHEMA:
Library (Library_ID, Institute_name, Seller_ID)
Members (Member_ID, Fine, PRN, Year, Library_ID)
Members_Books_issued (Member_ID, Books issued)
Members_Books_returned (Member_ID, Books returned)
Books (ISBN, Price, Title, Category, Publisher_ID, Member_ID, Author_ID)
Publisher (Publisher_ID, Name, Seller_ID)
Author (Author_ID, Name)
Seller (Seller_ID, Book_stock, Name, Library_ID, Publisher_ID)
3) ONLINE GROCERY ORDERING SYSTEM:
RELATIONAL SCHEMA:
Customer (Customer_ID, Name, Address, Email, Domain)
Online Store (Domain, Name, Customer_ID)
Items (Item_ID, Name, Price, Domain, Company name, Cart_ID)
Company (Company name)
Shopping Cart (Cart_ID, Item_ID, No, of Items, Amount)
Payment (Credit Card no., OTP Verification, Expiry, Total Amount, CVV)