Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve 5th part Write the following questions as queries in Relational Algebra. Use only the operators discussed in class (select, project, Cartesian product, join,

Please solve 5th part

image text in transcribed

Write the following questions as queries in Relational Algebra. Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming in particular, no outer joins or aggregations). Type your answers. If you can't find Greek letters in your word processor, you can simply write out the operator, all uppercase (i.e. 'SELECT'). Please use renaming consistently, as indicated in the handout. Before starting, make sure you understand the schema of the database. If you are in doubt about it, please ask the instructor. Assume a database with schema AUTHORS(name, age,address, nationality) BOOKS(title, year,genre, price, num-pages, publisher) WRITES(name,title, royalty) where the table AUTHORS contains information about writers, and name is the primary key; BOOKS contains information about books (their title, the year they were published, their price, the number of pages and the publisher who published it) and title is the primary key. Attribute genre is one of 'humor', 'biography', 'sci-fi', 'horror' and so on. WRITES tells us which author has written which book(s) (so name and title are foreign keys in WRITES), and what percentage of the book price they got in royalties." Note that an author may have written several books, and a book may have been written by several authors jointly; the key of WRITES is (name,title). Write the following questions in Relational Algebra: 1. List the titles and prices of books from author Stephen King published in 1999. 2. List the names and ages of authors who have written a humor published by publisher 'Springer'. 3. List the names of publishers who have published a biography or a humor book. 4. List the names of publishers who have published both a biography and a humor book. 5. List pairs of authors who have written a book together (note: the schema of your answer should be (name1, name2), where both name1 and name2 are names of authors)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions