Docsity

Library Management System Database - Prof. Albano, Lab Reports of Web Design and Development

Toggle sidebar
bg1
JERWIN M. BURAGA
NOLIE Z. CELIS
JAN LIANZ B. APOSTOL
JOMARI A. PINEDA
JHON MARK C. PAGULAYAN
1. How many books on “The Killing Zone” is available? Name the column as
Total_Number_of_Book_Available.
SELECTbookidASTotal_Number_of_Book_AvailableFROM`tblbook`WHEREtitle
='The Killing Zone';
2. Who are the author and publisher of the killing zone book?
SELECTtblbook.title,tblpublisher.publisherFROMtblbook,tblpublisherWHE
REtblbook.bookid=1ANDtblpublisher.publisherid=2;
3. ISBN 444 belongs to what publisher?
SELECTtblbook.title,tblbook.isbn,tblpublisher.publisherFROMtblbook,tbl
publisherWHEREtblbook.isbn='866-844-444-3'ANDtblpublisher.publisherid
=2;
4. Display the title of the book and publisher in one column and name as the column in Library.
SELECTtitleASLibraryFROMtblbookUNIONSELECTpublisherFROMtblpublish
er;
pf3
pf4

Partial preview of the text

Download Library Management System Database - Prof. Albano and more Lab Reports Web Design and Development in PDF only on Docsity!

JERWIN M. BURAGA

NOLIE Z. CELIS

JAN LIANZ B. APOSTOL

JOMARI A. PINEDA

JHON MARK C. PAGULAYAN

1. How many books on “The Killing Zone” is available? Name the column as

Total_Number_of_Book_Available.

SELECT bookid AS Total_Number_of_Book_Available FROM tblbook WHERE title = 'The Killing Zone';

2. Who are the author and publisher of the killing zone book?

SELECT tblbook.title, tblpublisher.publisher FROM tblbook, tblpublisher WHE RE tblbook.bookid = 1 AND tblpublisher.publisherid = 2 ;

3. ISBN 444 belongs to what publisher?

SELECT tblbook.title,tblbook.isbn, tblpublisher.publisher FROM tblbook, tbl publisher WHERE tblbook.isbn = '866-844-444-3' AND tblpublisher.publisherid = 2 ;

4. Display the title of the book and publisher in one column and name as the column in Library.

SELECT title AS Library FROM tblbook UNION SELECT publisher FROM tblpublish er;

5. Who are the borrowers who have the access to the “The Killing Zone” book?

SELECT tblborrower.borrower, tblbook.title FROM tblborrower, tblbook WHERE tblborrower.borrowerid = 2 AND tblbook.bookid = 1 ;

6. What is the total price of “Man of Steel” book? And name as the total price.

SELECT title, quantity, price, SUM(price) * quantity AS Total_Price FROM tb lbook WHERE title = 'Man Of Steel';

7. Show list of borrowers on 2022-10-10 and name as date_issued.

SELECT tblborrower.borrower AS date_issued FROM tblborrower, tblborrowed_bo oks WHERE tblborrower.borrowerid = tblborrowed_books.borroweid AND tblborro wed_books.issuedate = '2022-10-10';

8. Create an additional province field for publisher?

ALTER TABLE tblpublisher ADD province VARCHAR( 50 ) AFTER address;