Question

Programming Assignment This is a database course using Open Office Database. Assume that you have been...

Programming Assignment

This is a database course using Open Office Database.

Assume that you have been given the task of creating a system for a library to keep track of their books, the borrowers of the books, and the books that are currently lent out. Your first step will be to create the relations necessary for this system.

Book will need information such as a unique identifier for each book, title, author, ISBN number, date of publication, cost.

Borrower will need information such as a unique identifier for the person such as a library card number, name, address, phone number, date of membership

BooksLended will need information such as the book checked out, the date the book was checked out, when it must be returned, the borrower of the book, etc.

Librarian will need information on the librarians who can perform the check out of a book. This will include a way to identify each librarian, their name, and extension phone number.

Be sure to identify what are candidate, primary, alternate keys and the degree of each relation. It would be recommended that you document your relations in the manner used in the Sharma et al.text.

Assignment Grading Rubric

•Assignment documents the relations required for the library system and includes each of the following:

o Book

o Borrower

o BookLended

o Librarian

•Each relation must define an identifier and its data types that uniquely identifies each tuple

•The degree of each relation must be described

•Each relation must include appropriate information other than identifiers such as attributes and the data type of attributes

o The book relation includes at least title, author, ISDN number, date of publication, and cost along with the data types that are appropriate to the data

o The borrower relation includes at least library card #, name, address, postal code, phone number, and date of membership along with the data types that are appropriate to the data

o The booklended relation includes at least borrower, check out date, return date, book id, librarian

o The librarian relation includes at least librarian id, name, phone number

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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);

Please let me know in case of any clarifications required. Thanks!

Add a comment
Know the answer?
Add Answer to:
Programming Assignment This is a database course using Open Office Database. Assume that you have been...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that you are working with a hospital and this hospital needs a software system to...

    Assume that you are working with a hospital and this hospital needs a software system to track its patients’ information. Your role in this software development is to design the database. There are many aspects of such a hospital software system to develop. However, in this assignment, you will only address interactions between doctors and patients. Your first step will be to create the relations necessary for this system and identify and describe the constraints that would be appropriate for...

  • c) Write an ER Diagram for the following Library database. Identify all the Entities, Relationships and Attributes. Underline the primary keys and mark the different constraints. You can add an I att...

    c) Write an ER Diagram for the following Library database. Identify all the Entities, Relationships and Attributes. Underline the primary keys and mark the different constraints. You can add an I attribute as a primary key for an entity to make t unique if necessary. Library has a number of branches in the city, each branch having a name, address and librarian. Books have title, authors and publisher. A book can have multiple authors but a single publisher. Note that same...

  • Specify relational calculus expression for the following descriptions on the Library database schema shown in Figure...

    Specify relational calculus expression for the following descriptions on the Library database schema shown in Figure 4.6. a) Retrieve Publishers’ name and phone number whose books where borrowed from Baltimore Branch. b) List the book title, book id and branch name with less than 10 copies c) List customer card number, customer name, branch name and book title for books which are currently on loan. BOOK Book id Title Publisher_name BOOK_AUTHORS Book idAuthor name PUBLISHER Name Address Phone BOOK COPIES...

  • 3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra...

    3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra expressions for the following two queries. No SQL statements are required. BOOK Bookid Title Publisher name BOOK AUTHORS Book id Author name PUBLISHER Name Address Phone BOOK COPIES Book d Branch Id No o copies BOOK LOANS Book Branch Id Card no Date out Due date LIBRARY BRANCH Branch Branch name Address BORROWER Card Name Address Phone 3.A.) (10 POINTS) Let the number of...

  • This assignment consists of a series of SQL questions. For each question, you will need to...

    This assignment consists of a series of SQL questions. For each question, you will need to include: • SQL query. • An explanation of the query. Please include explanations as a comment AFTER your query, e.g., enclosed within a /* comments block */ ). See the first example in the SQL tutorial for a comment. You don’t need to explain straightforward code in comments. Only the parts that are interesting or different, so that we understand what you did. Question-1...

  • 2.   A college needs a database that supports its placement office to help college students finding...

    2.   A college needs a database that supports its placement office to help college students finding out potential employers. The primary purpose of the database is to schedule interviews and facilitate searches by students and companies. The requirements are the followings: •   Student data include a unique identifier, a name, phone number, an email address, a web address, a major, a minor, and a GPA. •   The placement office maintains a standard list of positions based on the Labor Department's...

  • The primary keys are underlined. The foreign keys are denoted by asterisks (*). Description of the...

    The primary keys are underlined. The foreign keys are denoted by asterisks (*). Description of the schema: • person — keeps track of the people who borrow books from the library. The attributes contain personal and contact information. • author — keeps track of personal information about authors. • publisher — keeps track of the publisher information. To keep it simple, most of the attributes have been truncated in the sample database. 1 trivial dependencies are things like X→X or...

  • For this DATABASE homework assignment you will create an Entity Relationship model for a business case...

    For this DATABASE homework assignment you will create an Entity Relationship model for a business case and then convert the model to a set of relations.  Read through the following business case for the “Drum Corps International”  Create an Entity relationship model with the necessary entities, attributes, identifiers and relationships to capture the data requirements.  All relationships should be labeled with verb phrases.  Use UML notation for this work.  Relationship lines should not cross. ...

  • Case Study:UniversityLibrarySystem This case is a simplified (initial draft) of a new system for the University...

    Case Study:UniversityLibrarySystem This case is a simplified (initial draft) of a new system for the University Library. Of course, the library system must keep track of books. Information is maintained about both book titles and the individual book copies. Book titles maintain information about title, author, publisher, and catalog number. Individual copies maintain copy number, edition, publication year, ISBN, book status (whether it is on the shelf or loaned out), and date due back in. The library also keeps track...

  • This project supposed to develop a database system for a library for a university. The system...

    This project supposed to develop a database system for a library for a university. The system contains information about books, book authors, students, and faculty. Students and faculty are allowed to borrow books from the library. You should design the system to contain entities and attributes to store data that makes the system able to report the requested information by executing the queries. SQL Queries: 1. List the names and email for students who borrowed books along with the number...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT