Question
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]
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
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