Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following set of relations, which describe coffee and coffee drinkers: DRINKS ( PERSON , COFFEE ) HAS _ BEAN ( COFFEE , BEAN

Consider the following set of relations, which describe coffee and coffee drinkers:
DRINKS (PERSON, COFFEE)
HAS_BEAN (COFFEE, BEAN_NAME)
BEAN (BEAN_NAME, FROM_LOCATION)
The relation DRINKS tells us which people drink which coffees. People can drink more than one coffee. The HAS_BEAN relation tells us what coffee beans go into each type of coffee. A coffee can have many beans. And the BEAN relation tells us which location each coffee bean comes from; a bean can grow in multiple relations.
(1) Write RA expressions to compute each of the following. Note that you can abbreviate attribute names if youd like to write less (you can use P for PERSON, C for COFFEE, BN for BEAN_NAME, and FL for FROM_LOCATION). Each is worth 1/2 point, except for 1(c), which is worth 1 point.
(a) Which locations grow both the beans Catuai and "Catimor"?
(b) Which people drink a coffee that contains a bean from "Brazil" or from "Peru"?
(c) Which countries produce all of the beans in the coffee "Breakfast Delight" (or "BD")?
(2) Consider the same set of relations. Write RC expressions to compute each of the following. Again, you can abbreviate attribute names. Each is worth 1/2 point, except for 2(c), which is worth 1/2 point.
(a) Which locations contribute a bean to a coffee consumed by Chris?
(b) Which people don't drink any of the coffees that are consumed by "Chris"?
(c) Which people drink a set of coffees that together contain all of the beans from Hawaii?

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions