Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q. CUSTOMER (CID, NAME, STREET, CITY, STATE, AGE) SALE (PID, CID, DATE, COST) PART (PID, PNAME, COLOR) The meaning of these relations is straightforward; for

image text in transcribed
Q. 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. Find the names and addresses of customers who bought parts averaging more than $50. 2. For each customer of the city of Trenton who bought more than 5 distinct red parts, retrieve his/her CID and the total number of parts that he/she bought. 3. Retrieve the names of the red parts sold at a price lower than that of every blue part. 4. Only customers from the city of Princeton can buy orange parts. 5. No customer is allowed to buy more than 10 (not necessarily distinct) orange parts

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes Browsers And Databases Data Mining Tools For Integrated Genomic Databases

Authors: Peter Schattner

1st Edition

0521711320, 978-0521711326

More Books

Students also viewed these Databases questions

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago