We consider the following relation Stock. The primary key of Stock is prodid, depid. prodid depid prodname
Fantastic news! We've Found the answer you've been seeking!
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 | 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.
Related Book For
Advanced Accounting
ISBN: 978-1934319307
2nd edition
Authors: Susan S. Hamlen, Ronald J. Huefner, James A. Largay III
Posted Date: