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, 22.06.2019 00:30
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
question
Computers and Technology, 22.06.2019 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 24.06.2019 19:20
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
You know the right answer?
Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string...
Questions
question
Mathematics, 25.10.2019 17:43
Questions on the website: 13722363