subject

Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string, ZIP: string) PARTS (PID: integer, PNAME: string, COLOR: string) CATALOG (SID: integer, PID: integer, COST: real)
The primary key attributes are underlined, and the domain of each attribute is listed after the attribute name. Thus, SID is the primary key for SUPPLIERS, PID is the primary key for PARTS, and SID and PID together form the primary key for CATALOG. Attribute SID in CATALOG is a foreign key that refers to the primary key SID of SUPPLIERS and PID in CATALOG is a foreign key that refers to the primary key PID of PARTS. The CATALOG relation lists the prices charged for parts by suppliers.
State what the following query computes.
0. πCITY (πPID (σ COLOR = 'green' (PARTS) ) * σ COST>50 (CATALOG) * πSID, CITY (SUPPLIERS) )
Write the following queries in relational algebra.
1. Find the names of parts for which there is some supplier
2. Find the names of parts supplied by suppliers who are at 1 Central Ave.
3. Find the names of suppliers who supply some red part.
4. Find the SIDs of suppliers who supply some red or green part.
5. Find the SID of suppliers who supply some red part or whose address is '221 Packer Street'.
6. Find the SIDs of suppliers who supply some red part and some green part.
7. Find the PIDs of parts that are red or are supplied by a supplier who is at the city of Newark.
8. Find the PIDs of parts supplied by a supplier who is at the city of Newark and by a supplier who is at the city of Trenton.
9. Find the PIDs of parts supplied by every supplier.
10. Find the PIDs of parts supplied by every supplier who supplies at least one part.
11. Find the SIDs of suppliers who supply at least two different parts (you are not allowed to use a grouping/aggregation operation for this query).
12. Find the SIDs of suppliers who supply at least two different parts (you have to use a grouping/aggregation operation for this query).
13. For every part, find its PID, its PNAME and the number of suppliers who sell it.
14. List the PID, PNAME and average cost of all parts.
15. Find the average cost of red parts.
16. Find the average cost of parts supplied by suppliers named 'Yosemite Sham'.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
Python. primary u.s. interstate highways are numbered 1-99. odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. thus, the 405 services the 5, and the 290 services the 90. given a highway number, indicate whether it is a primary or auxiliary highway. if auxiliary, indicate what primary highway it serves. also indicate if the (primary) highway runs north/south or east/west.
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 2
You know the right answer?
Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string...
Questions
question
Mathematics, 15.05.2021 03:40
question
Computers and Technology, 15.05.2021 03:40
question
Mathematics, 15.05.2021 03:40
question
Mathematics, 15.05.2021 03:40
Questions on the website: 13722361