Question: ****This is based on a prev assignment which I will try to include. Using the relations that you have defined for the library system, normalize
****This is based on a prev assignment which I will try to include.
Using the relations that you have defined for the library system, normalize your relations into first, second, and third normal form. Your output should be an Entity Relationship diagram that is in 3NF. All attributes, entities, keys, and relationships should be included and labeled. Although you do not need to include an ER diagram (unless you want to) for the relations in 1st normal form or 2nd normal form, you must describe the changes required to your relations to meet the standard of first 1st normal form and then 2nd normal form and of course 3rd normal form.
Assignment Instructions:
the assignment must define or describe the changes required to get the relations into the 1st normal form
the assignment must define or describe the changes required to get the relations into the 2nd normal form
the assignment should include an Entity Relationship diagram that details each of the following relations and their attributes in 3rd normal form.
Book
Borrower
BookLended
Librarian
the primary and foreign keys, at a minimum are defined for each relation in the ER diagram
the assignment should include an Entity Relationship diagram that details the relationships between Relations. Be sure to copy and paste this diagram into your assignment,
Please find the Tables for Library Management System:-
CREATE TABLE Books (
ISBN INT NOT NULL ,
book_name VARCHAR( 100 ) NOT NULL ,
book_status CHAR( 1 ) NOT NULL ,
book_type INT NOT NULL,
book_edition INT NOT NULL ,
book_publisher INT NOT NULL ,
PRIMARY KEY ( ISBN )
);
CREATE TABLE Book_Type (
book_type_id INT NOT NULL ,
book_type_name VARCHAR( 50 ) NOT NULL
PRIMARY KEY ( book_type_id )
);
CREATE TABLE Author (
author_id INT NOT NULL,
author_fname VARCHAR ( 50) NOT NULL ,
author_fname VARCHAR ( 50) NOT NULL ,
author_email VARCHAR ( 100) NOT NULL
);
CREATE TABLE Publisher (
publisher_id INT NOT NULL,
publisher_name VARCHAR (100) NOT NULL,
PRIMARY KEY ( publisher_id )
);
CREATE TABLE Book_Author (
book_id INT NOT NULL ,
author_id INT NOT NULL
);
CREATE TABLE Member (
member_id INT NOT NULL ,
member_fname VARCHAR( 50 ) NOT NULL ,
member_lname VARCHAR( 50 ) NOT NULL,
member_phone VARCHAR( 25 ) NOT NULL ,
member_email VARCHAR( 100 ) NOT NULL ,
member_email VARCHAR( 100 ) NOT NULL ,
member_type INT NOT NULL ,
member_address INT NOT NULL ,
PRIMARY KEY (member_id )
);
CREATE TABLE Member_Type (
member_type_id INT NOT NULL ,
member_type_name VARCHAR( 50 ) NOT NULL ,
member_type_allowed_day INT NOT NULL ,
member_type_fine INT NOT NULL ,
PRIMARY KEY (member_type_id)
);
CREATE TABLE Address (
address_id INT NOT NULL ,
address_desc TEXT NOT NULL ,
postcode INT NOT NULL ,
PRIMARY KEY (address_id )
);
CREATE TABLE Postcode (
postcode_id INT NOT NULL,
postcode_description VARCHAR( 10 ) NOT NULL ,
PRIMARY KEY (postcode_id )
);
CREATE TABLE Librarian (
librarian_id INT NOT NULL ,
librarian_fname VARCHAR( 50 ) NOT NULL ,
librarian_lname VARCHAR( 50 ) NOT NULL ,
librarian_address INT NOT NULL ,
librarian_phone VARCHAR( 25 ) ,
librarian_email VARCHAR( 100 ) ,
PRIMARY KEY ( `librarian_id` )
);
CREATE TABLE Borrow (
borrow_id INT NOT NULL ,
member_id INT NOT NULL ,
ISBN INT NOT NULL ,
librarian_id INT NOT NULL ,
borrow_date DATE NOT NULL ,
return_date DATE ,
expected_return_date DATE NOT NULL ,
PRIMARY KEY (borrow_id )
);
CREATE TABLE Fine (
fine_id INT NOT NULL ,
borrow_id INT NOT NULL ,
librarian_id INT NOT NULL ,
fine_amount FLOAT NOT NULL
fine_paid CHAR( 1 ) NULL ,
PRIMARY KEY ( `fine_id` ),
INDEX (borrow_id)
);
ALTER TABLE Books ADD FOREIGN KEY (book_type) REFERENCES Book_Type (book_type_id) ;
ALTER TABLE Books ADD FOREIGN KEY ( `book_publisher` ) REFERENCES Publisher( publisher_id ) ;
ALTER TABLE Book_Author ADD FOREIGN KEY ( ISBN ) REFERENCES books( ISBN ) ;
ALTER TABLE Book _ Author ADD FOREIGN KEY ( author_id ) REFERENCES Author( author_id ) ;
ALTER TABLE Member ADD FOREIGN KEY ( member_address ) REFERENCES Address( address_id ) ;
ALTER TABLE Member ADD FOREIGN KEY ( member_type) REFERENCES Member_Type( member_type_id ) ;
ALTER TABLE Librarian ADD FOREIGN KEY ( librarian_address ) REFERENCES Address( address_id ) ;
ALTER TABLE Borrow ADD FOREIGN KEY ( member_id ) REFERENCES Member( member_id ) ;
ALTER TABLE Borrow ADD FOREIGN KEY ( ISBN ) REFERENCES books(ISBN) ;
ALTER TABLE Borrow ADD FOREIGN KEY ( librarian_id) REFERENCES Librarian( librarian_id );
ALTER TABLE fine ADD FOREIGN KEY ( borrow_id) REFERENCES Borrow( borrow_id );
ALTER TABLE fine ADD FOREIGN KEY ( librarian_id ) REFERENCES Librarian( librarian_id );
ALTER TABLE address ADD FOREIGN KEY ( postcode ) REFERENCES Postcode( postcode_id);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
