473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Assume a bookshop has database with the following

Question 1: Assume a bookshop has database with the following

schema of six relations:

Authors (au_id, au_lname, au_fname, phone, address)
Publishers (pub_id, pub_name, city, state, country)
Sales (stor_id, ord_num, qty, title_id)
Stores (stor_id, stor_name, stor_address, city, state, zip)
Titleauthor (au_id, title_id, royaltyper, au_ord)
Titles (title_id, title, type, pub_id, price, pubdate)

Write the following queries in relational algebra:

i. List the authors first and last names for the book titled ‘Life Without Fear’
ii. List the titles of the books sold at Barnum’s. (stor_name)
iii. Give the last names (au_lname) and au_ids of the authors whose books have sold in the store named Barnum’s. Assign an alias to your answer.
iv. Using your alias from the previous problem, give the last names and au_ids of the authors whose books have not sold in the store named Barnum’s
v. List the titles of books, which have not sold any copies at any store (no books sold at all.)
vi. List the titles of the books, which have only sold at Barnum’s. (Do not list the books, which have not sold anywhere.)
vii. List the titles of the books, which have sold at both Barnum’s and Bookbeat. (Two stor_names)
viii. List the titles and stor_names for each book when the book has sold and the title only (with null for the stor_name) if the book has not sold. (Use an outer join.)
ix. List the stor_ids of the stores which have sold all books published by New Moon Books (pub_name)
x. List the titles of the books, which have sold at all stores.
Oct 31 '08 #1
1 1634
r035198x
13,262 8TB
What have you done so far?
Please read the posting guidelines
Oct 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Cherrish Vaidiyan | last post by:
sir, The following are the steps that i followed in setting up standby database on Red hat Linux 9. i am using Oracle 9i. i have followed the steps in this site : ...
1
by: Ben M. | last post by:
Greetings all, This should be an easy task, and Im sure it is, but as many times as I have tried, I cant seem to get this to work properly. We changed ISPs recently from a shared host to a...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
2
by: Anantha | last post by:
Dear All, One day our Windows 2000 Server OS crashed, so our NT admin has re-installed the OS on C: drive. Fortunately we kept our database file and installation in F: drive. When we...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
22
Frinavale
by: Frinavale | last post by:
How To Use A Database In Your Program Many .NET solutions are database driven and so many of us often wonder how to access the database. To help you understand the answer to this question I've...
0
by: piyushdabomb | last post by:
Hi Oracle Gurus!! Before I proceed, as per the moderators request, I would like to mention that I have already taken a look at the other threads pertaining to a similar issue which I am having and...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.