Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the following relations: Publisher Printer a) Using SELECT, PROJECT, and J

ID: 3556821 • Letter: G

Question

Given the following relations:


Publisher


Printer


a) Using SELECT, PROJECT, and JOIN, write code to find the printers who
can supply books with a rating over 4.3.

Ex Answer..

TEMP1 <- SELECT from PRINTER

TEMP2 <- JOIN TEMP1

TEMP3 <- JOIN TEMP2 (IF NEEDED)

RESULT <- PROJECT Name, Title from TEMP3


b) Explain clearly what question is answered by the following code.

TEMP1 ? SELECT from Printer
where Cost < 5.00
TEMP2 ? JOIN TEMP1 and Publisher
where TEMP1.ISBN = Publisher.ISBN
RESULT ? PROJECT Title from TEMP2

c) What are the results of this database query?

Title Author ISBN Rating War and Peace Tolstoy 425 4.5 Crime and Punishment Dostoevsky 426 4.5
Madame Bovary Flaubert 427 4.0

Explanation / Answer

1.

temp1 <-- select from publisher
where publisher.rating >4.3
temp2 <-- join printer
where printer.ISBN = publisher.ISBN )
Result <--project printer from tem
p2

2.

TEMP1 ? SELECT from Printer
where Cost < 5.00
TEMP2 ? JOIN TEMP1 and Publisher
where TEMP1.ISBN = Publisher.ISBN
RESULT ? PROJECT Title from TEMP2         

Ans :
This will find all the title from the publisher whose printer cost is less than 5

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote