Question
We consider the following relation Stock. The primary key of Stock is prodid, depid. prodid depid prodname quantity p1 d1 vcr 10 p1 d2 vcr
We consider the following relation Stock. The primary key of Stock is prodid, depid.
prodid | depid | prodname | quantity |
p1 | d1 | vcr | 10 |
p1 | d2 | vcr | 20 |
p2 | d3 | tv | 30 |
(a) Write the following query in relational algebra. What are the prodnames? (b)Write the following query in relational algebra. What are the ids of the depts that are stocked with a quantity > 20? (c) Write the following query in SQL. What is the average of the quantity of EACH depot? (quantity > 0) (d) Write the following query in SQL. What is the sum of the quantities of EACH depot? (quantity> 0) (e) The primary key of Stock is prodid, depid What trivial functional dependencies can you deduce from this fact?(f) Is there redundancy in the Stock table? Explain.
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 StartedRecommended Textbook for
Advanced Accounting
Authors: Susan S. Hamlen, Ronald J. Huefner, James A. Largay III
2nd edition
1934319309, 978-1934319307
Students also viewed these Databases questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App