Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Advanced Accounting

Authors: Susan S. Hamlen, Ronald J. Huefner, James A. Largay III

2nd edition

1934319309, 978-1934319307

More Books

Students also viewed these Databases questions