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 of books they have borrowed. 2. List the names and departments for instructors who have borrowed books. 3. List all the books that are borrowed along with the borrower name and borrowing date. 4. List the names and email for all borrowers who have not returned the books. 5. List all books for a particular author. 6. List all books that belong to “Information Technology” field.
SQL queries:
#1
select A.UserId, B.UserName, B.UserEmail, count(A.BookId) noofbooksborrowed
from userborrowbooks as A join users as B
on A.UserId = B.UserId
group by A.UserId, B.UserName, B.UserEmail;
#2
select A.UserId, B.UserName, B.Department
from userborrowbooks as A join users as B
on A.UserId = B.UserId
where B.IsInstructor=1;
#3
select A.BookId, c.BookTitle, B.UserName, A.BorrowDate
from userborrowbooks as A join users as B
on A.UserId = B.UserId
join books c
on A.BookId = c.BookId;
#4
select A.UserId, B.UserName, B.UserEmail
from userborrowbooks as A join users as B
on A.UserId = B.UserId
where A.ReturnDate is null;
#5
select A.BookId, A.BookTitle
from books as A join booksbyauthor as B
on A.BookId = B.BookId
join author as C
on B.AuthorId = C.AuthorId
where C.AuthorName='';
#6
select A.BookId, A.BookTitle
from books as A join booksbycategory as B
on A.BookId = B.BookId
join category as C
on B.CategoryId = C.CategoryId
where C.CategoryName='Information Technology';
This project supposed to develop a database system for a library for a university. The system...
Library System Project The library at the University stores different items that can be borrowed, including books and journals. The library offers this service to a university members who include: students, staff and faculty members, but only faculty members can borrow journals. Students can borrow up to a maximum of 5 books and staff can bormow up to a maximum of 7 books, and faculty member can borow up to a maximum of 10 books and 3 journals. When a...
Consider the following table schemas (primary keys are underlined): Book (BookId, Title, Publishername) Book_Authors (BookId, AuthorName) Publisher (Name, Address, Phone) Book_Copies (BookId, BranchId, No_Of_Copies) Book_Loans (BookId, BranchId, CardNo, DateOut, DueDate) Library_Branch (BranchId, BranchName, Address) Borrower (CardNo, Name, Address, Phone) Write SQL statements for the following queries: List the number of copies of the book titled “The Lost Tribe” owned by each library branch and the corresponding library branch name. List the names and addresses of all borrowers who have borrowed more than 5 books...
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...
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...
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...
Draw the Data Flow Diagram for the following requirements The School of Automation wants a new web application developed for managing their library. The items maintained in the library are books, videos, and software. Students, faculty, staff of the university, besides the residents of the state of Iowa are provided borrower privileges. A Call number uniquely identifies each item in the library. The phase 1 of the software involves Adding a new item to the library: The details of the...
Author(name, address, URL)
Book(ISBN, title, year, price,
publisher_Name)
WrittenBy(name, address, ISBN)
Publisher(name, address, phone, URL)
Warehouse(code, phone, address)
Stocks(ISBN, WH_code, number)
Shopping-Basket(basketID, email)
basketContains(ISBN, basketID, number)
Customer(email, name, address, phone)
Referring to the relational model in slide 15 in"ER-mapping" (about author, publisher, shopping-basket, provide the algebraic pressing for the following queries Q1: Report the book title, and year for the books that have been written by exactly 2 authors, one of them is Mark Smith" Q2: For each customer,...
Database
Exercise I (50 pts): This exercise deals with a database that stores information about Hotel Management System. Customer (C email, name, country) Payment (Invoice id, C email, payment method, date) invoice (Invoice id, starus, invoice description) Has (Bill id. Invoice id) 9a Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id, room id, C email, date, period, reservation id) Rooms(Hotel id. room id, price, category) Hotel (Hotel id. H name. country) Own (room id,...
Design an ER diagram for a library management system. The library manages books, members, and books borrowed by members. The library has several branches around the city. Each branch has a name and address and is identified by a branch ID. Each book in the system is identified by a unique ISBN along with its title, author(s), and publisher. A publisher is identified by its name, address, and phone. Note that publishers may be based anywhere around...
Design an ER diagram for a library management system. The library manages books, members, and books borrowed by members. The library has several branches around the city. Each branch has a name and address and is identified by a branch ID. Each book in the system is identified by a unique ISBN along with its title, author(s), and publisher. A publisher is identified by its name, address, and phone. Note that publishers may be based anywhere around...