Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 (Total 13 Points): Answer questions 3.1 and 3.2 based on the following schema (data types are not needed). Product ( pid , pname,

Question 3 (Total 13 Points):

Answer questions 3.1 and 3.2 based on the following schema (data types are not needed).

Product(pid, pname, type, manufacturer, price)

Buys(cid, pid,quantity)

Customer(cid, cname, age, gender)

(3.1) (8 Points) For parts 3.1.1), 3.1.2), and 3.1.3), write SQL statements to return the required information.

3.1.1) (2 Points) Find names and types of all products that are manufactured by Sears.

3.1.2) (3 Points) Find names of all customers who have purchased a product that is manufactured by Acme and have a gender of Coyote

3.1.3) (3 Points) Find type and price of all products that have been purchased by a customer who is older than 42 years old and quantity > 10.

3.2) (5 Points) Answer parts 3.2.1) and 3.2.2) based on the following SQL query,

SELECT P.manufacturer

FROM Product P, Buys B

WHERE P.pid=B.pid and P.pname=Stuffed Puppy Dog and B.quantity < 11

3.2.1) (2 Points) Write an English sentence to explain the output of the query.

3.2.2) (3 Points) Write the relational algebra expression that is equivalent to the given SQL query

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions