Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO NOT POST INCORRECT, IRRELEVANT, RANDOM OR DUPLICATED ANSWERS, IF YOU DO I WILL CONTACT CHEGG SUPPORT AND GET YOU SUSPENDED. PLEASE ANSWER THE ENTIRE

DO NOT POST INCORRECT, IRRELEVANT, RANDOM OR DUPLICATED ANSWERS, IF YOU DO I WILL CONTACT CHEGG SUPPORT AND GET YOU SUSPENDED.

PLEASE ANSWER THE ENTIRE PROBLEM, IT IS ALL PART OF ONE.

3 Database Querying[45]

Garden(GardenID, GardenName, Sunlight, Water, GardenerID)

Gardener(GardenerID, GardenerName, Age)

Plant(PlantID, PlantName, Sunlight, Water, Weight)

Planted(PlantID, GardenID, Date, Seeds)

Picked(PlantID, GardenID, Date, Amount, Weight)

The database is for a small gardener association. The keys are underlined.

The gardeners plant their garden in the spring and pick their garden in summer

The sunlight attribute refers to the percentage of a 24 hour/day that the the plant optimally gets sunlight for a plant and the percentage of a 24 hour/day that the the garden gets on average.

This value depends on the plant and garden location. A garden that is in a shadow of a building will obviously get less exposed to the sunlight.

The water attribute refers to the percentage of average rainfall that makes it to the root level for a plant and the average rainfall that the entire garden receives for a garden. This value also depends on the location. It is known that some regions get more rainfall than others even within

the same state.

The plant (average expected) and picked (actual) weight is in pound

The picked amount is the number of items (one carrot, one beet, an ear of corn, one tomato, one radish) picked.

A. Express queries 2,3 and 4 in relational algebra (3 queries, 4 points per query).

B. Express queries 1 and 4 in relational calculus (2 queries, 4 points per query).

C. Express all the queries in SQL (6queries, 4 points per query except query 6).

1. List the plants in John Does garden

2. List the gardens that have at least 1 plant in common with John Does garden.

3. List the gardens that have none of the plants in John Does garden.

4. Which plants are found in every garden

5. Give the total number of plants per garden

6. List pair of gardens that have exactly the same plants [5 points]

image text in transcribed

3 Database Querying[45] Garden(GardenID, GardenName, Sunlight, Water, GardenerID) Gardener(GardenerID, GardenerName, Age) Plant(PlantID , PlantName, Sunlight, Water, Weight) Planted(PlantID, GardenID, Date, Seeds) Picked(PlantID, GardenID, Date, Amount, Weight) The database is for a small gardener association. The keys are underlined. - The gardeners plant their garden in the spring and pick their garden in summer - The sunlight attribute refers to the percentage of a 24 hour/day that the the plant optimally gets sunlight for a plant and the percentage of a 24 hour/day that the the garden gets on average. 'This value depends on the plant and garden location. A garden that is in a shadow of a building will obviously get less exposed to the sunlight. - The water attribute refers to the percentage of average rainfall that makes it to the root level for a plant and the average rainfall that the entire garden receives for a garden. This value also depends on the location. It is known that some regions get more rainfall than others even within the same state. - The plant (average expected) and picked (actual) weight is in pound - The picked amount is the number of items (one carrot, one beet, an ear of corn, one tomato, one radish) picked. A. Express queries 2,3 and 4 in relational algebra (3 queries, 4 points per query). B. Express queries 1 and 4 in relational calculus (2 queries, 4 points per query). C. Express all the queries in SQL (6queries, 4 points per query except query 6 ). 1. List the plants in John Doe's garden 2. List the gardens that have at least 1 plant in common with John Doe's garden. 3. List the gardens that have none of the plants in John Doe's garden. 4. Which plants are found in every garden 5. Give the total number of plants per garden 6. List pair of gardens that have exactly the same plants [5 points]

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

50 Tips And Tricks For MongoDB Developers Get The Most Out Of Your Database

Authors: Kristina Chodorow

1st Edition

1449304613, 978-1449304614

More Books

Students also viewed these Databases questions

Question

Describe how stress makes us more vulnerable to disease.

Answered: 1 week ago

Question

what is the normality of a 0.3 M H3PO3 solution?

Answered: 1 week ago