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. 1. Write the following queries in relational algebra: 2. 3. (a) Find the sids of suppliers who supply some red or green part. (b) Find the sids of suppliers who supply every red part or supply every green part. (c) Find the pids of parts supplied by every supplier at less than $200. (If any supplier either does not supply the part or charges more than $200 for it, the part is not selected.) calculus: Write the following queries in either tuple relational calculus or domain relational (a) Find the names of suppliers who supply some red part. (b) Find the sids of suppliers who supply every red or green part. (c) Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham. Express queries (a)(c) in the relational algebra, and queries (b)(d) in the domain relational calculus: (a) Find the names of suppliers who supply exactly one red part. (b) List supplier-part (sid-pid) pairs where the part has the highest cost from this supplier. (c) List the name of each supplier who has at least one part that is not available from all other suppliers. (d) List each part (pid) that is available from exactly one supplier.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter2: Database Design Fundamentals
Section: Chapter Questions
Problem 5RQ: What is a relation?
icon
Related questions
Question

answer question 3 

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.
Transcribed Image Text: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.
1.
Write the following queries in relational algebra:
2.
3.
(a) Find the sids of suppliers who supply some red or green part.
(b) Find the sids of suppliers who supply every red part or supply every green part.
(c) Find the pids of parts supplied by every supplier at less than $200. (If any supplier either
does not supply the part or charges more than $200 for it, the part is not selected.)
calculus:
Write the following queries in either tuple relational calculus or domain relational
(a) Find the names of suppliers who supply some red part.
(b) Find the sids of suppliers who supply every red or green part.
(c) Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham.
Express queries (a)(c) in the relational algebra, and queries (b)(d) in the domain
relational calculus:
(a) Find the names of suppliers who supply exactly one red part.
(b) List supplier-part (sid-pid) pairs where the part has the highest cost from this supplier.
(c) List the name of each supplier who has at least one part that is not available from all other
suppliers.
(d) List each part (pid) that is available from exactly one supplier.
Transcribed Image Text:1. Write the following queries in relational algebra: 2. 3. (a) Find the sids of suppliers who supply some red or green part. (b) Find the sids of suppliers who supply every red part or supply every green part. (c) Find the pids of parts supplied by every supplier at less than $200. (If any supplier either does not supply the part or charges more than $200 for it, the part is not selected.) calculus: Write the following queries in either tuple relational calculus or domain relational (a) Find the names of suppliers who supply some red part. (b) Find the sids of suppliers who supply every red or green part. (c) Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham. Express queries (a)(c) in the relational algebra, and queries (b)(d) in the domain relational calculus: (a) Find the names of suppliers who supply exactly one red part. (b) List supplier-part (sid-pid) pairs where the part has the highest cost from this supplier. (c) List the name of each supplier who has at least one part that is not available from all other suppliers. (d) List each part (pid) that is available from exactly one supplier.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning