Question: consider the following schema: Suppliers (sid: integer, sname: string, address: string) Parts (pid: integer, pname: string, color: string) Catalog (sid: integer, pid: integer, cost: real)
consider the following schema:
Suppliers (sid: integer, sname: string, address: string)
Parts (pid: integer, pname: string, color: string)
Catalog (sid: integer, pid: integer, cost: real)
The key fields are underlined, and the domain of each field is listed after the field name. therefore sid is the key for suppliers, pid is the key for parts, and sid and pid together form the key for catalog. The catalog relation lists the prices charged for parts by suppliers. Write the following queries in relational algebra:
i. Find the names of suppliers who supply some red part.
ii. Find the sids of suppliers who supply some red or green part.
iii. Find the sids of suppliers who supply some red part or are at 221 packer street.
iv. Find the sids of suppliers who supply some red part and some green part.
v. Find pairs of sids such that the supplier with the first sid charges more for some part than the supplier with the second sid.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
