Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

I need it urgent please

CUSTOMER (CID, NAME, STREET, CITY, STATE, AGE)
SALE (PID, CID, DATE, COST)
PART (PID, PNAME, COLOR)
The meaning of these relations is straightforward; for example, SALE has one tuple for every part sold to a
customer. Primary key attributes are underlined. For instance, PID and CID together form the primary key of
relation SALE. SALE.PID is a foreign key that refers to PART.PID, while SALE.CID is a foreign key that refers to
CUSTOMER.CID.
Write SQL statements for the following retrieval and update operations.
1. Retrieve the names of all the customers from the city of 'Princeton' who bought a part at a cost less than
$100. No duplicates should appear in the answer.
2. Retrieve the names of red parts bought by a customer who is younger than 50 and from a customer who is
older than 50.
3. Delete all parts that are never bought by a customer from "Trenton" (this is a data change statement).
4. Retrieve the names of the customers who never bought a green part.
5. Retrieve the names of the customers who bought every green item.
6. Find the names and addresses of customers who bought parts averaging more than $100.
7. Retrieve the names of the green parts sold at a price higher than that of every yellow part.
8. For each customer of the city of Newark who bought more than 10 distinct green parts, retrieve his/her CID
and the total number of parts that he/she bought.
Edit
View Insert Format
Tools
Table
expand button
Transcribed Image Text:CUSTOMER (CID, NAME, STREET, CITY, STATE, AGE) SALE (PID, CID, DATE, COST) PART (PID, PNAME, COLOR) The meaning of these relations is straightforward; for example, SALE has one tuple for every part sold to a customer. Primary key attributes are underlined. For instance, PID and CID together form the primary key of relation SALE. SALE.PID is a foreign key that refers to PART.PID, while SALE.CID is a foreign key that refers to CUSTOMER.CID. Write SQL statements for the following retrieval and update operations. 1. Retrieve the names of all the customers from the city of 'Princeton' who bought a part at a cost less than $100. No duplicates should appear in the answer. 2. Retrieve the names of red parts bought by a customer who is younger than 50 and from a customer who is older than 50. 3. Delete all parts that are never bought by a customer from "Trenton" (this is a data change statement). 4. Retrieve the names of the customers who never bought a green part. 5. Retrieve the names of the customers who bought every green item. 6. Find the names and addresses of customers who bought parts averaging more than $100. 7. Retrieve the names of the green parts sold at a price higher than that of every yellow part. 8. For each customer of the city of Newark who bought more than 10 distinct green parts, retrieve his/her CID and the total number of parts that he/she bought. Edit View Insert Format Tools Table
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY