Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 ( 3 0 % ) Consider the following relational database schema that describes information about stores that sell bags and shoes, as well

Exercise 3(30%)
Consider the following relational database schema that describes information about stores that sell
bags and shoes, as well as the suppliers of the products. The relational schema Supplier has as primary
key the supplier-id and stores also the name and the city of a supplier. The relational schema Store has
as primary key the store-id and stores also the name and the city of a store. The relational schema
Product has as primary key the barcode of the product and stores also the pname and the price of a
product, the id of its supplier, supplier-id, as well as whether this product is shoes or a bag: if it is a
shoes then itsshoes has the value 'yes' and itsabag has the value 'no', whereas if the product is a bag
then itsshoes has the value 'no' and itsabag has the value 'yes'. The relational schema Has_stock stores
pairs of the store-id of stores and the barcode of products that these stores sell as well as the quantity
of the product in stock.
Supplier(supplier-id, name, city)
Store (store-id, sname, city)
Product(barcode, pname, price, itsshoes, itsabag, color,
supplier-id)
Has_stock(store-id, barcode, quantity)
Express in relational algebra the following queries:
A.(9%) Find the name of the stores that have at least 2 different bag designs in black color. Do not
use aggregation.
B.(7%) Find the price of all products that are shoes in the store named 'LaFollie'.
C.(7%) Find the names of all suppliers that supply more than 5 products with different barcodes,
whether these are shoes or bags. You can use aggregation.
D.(7%) Find the barcodes of the products that are sold by the store with store-id equal to '1' and by
the store with store-id equal to '2'. Do not use the intersection operator.
image text in transcribed

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

From Herds To Insights Harnessing Data Analytics For Sustainable Livestock Farming

Authors: Prof Suresh Neethirajan

1st Edition

B0CFD6K6KK, 979-8857075487

More Books

Students also viewed these Databases questions

Question

What is the relationship between humans?

Answered: 1 week ago

Question

What is the orientation toward time?

Answered: 1 week ago