Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write an SQL query for the attached. thank you Write the following questions as queries in SQL. Use only the operators discussed in class
Please write an SQL query for the attached. thank you
Write the following questions as queries in SQL. Use only the operators discussed in class - in particular, no outer joins. Type and format your answers. 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 AUTHOR(name, age, address, nationality) BOOK (title, year, genre, price, num-pages, publisher) WRITES(aname, btitle royalty) where the table AUTHOR contains information about writers, and name is the primary key: BOOK contains information about books (their title, the year they were published, their price, the number of pages and the name of 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 aname and btitle 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 (aname.btitle). Write the following questions in Relational Algebra: 1. List the title and price of any book with (at least) one English author and one Australian author. 2. List the names of publishers who have published a biography or a humor book. 3. List the names of publishers who have published both a biography and a humor book. 1. List the names of publishers who have published at least 2 books. 5. List the names of publishers who have never published a biographyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started