Please answer the following in SQL: Find all pairs of customers who have purchased the exact same combination of cookie flavors. For example, customers with ID 1 and 10 have each purchased at least one Marzipan cookie and neither customer has purchased any other flavor of cookie. Report each pair of customers just once, sort by the numerically lower customer ID. The MySQL-specific GROUP_CONCAT and JSON_ARRAYAGG functions are not permitted.   customers dataset CId: unique identifier of the customer LastName: last name of the customer FirstName: first name of the customer   goods dataset GId: unique identifier of the baked good Flavor: flavor/type of the good (e.g., "chocolate", "lemon") Food: category of the good (e.g., "cake", "tart") Price: price (in dollars)    items dataset Receipt : receipt number  Ordinal : position of the purchased item on the               receipts. (i.e., first purchased item,               second purchased item, etc...) Item : identifier of the item purchased (see goods.Id)   reciepts dataset RNumber : unique identifier of the receiipt SaleDate : date of the purchase.  Customer : id of the customer (see customers.Id)

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter12: Subqueries And Merge Statements
Section: Chapter Questions
Problem 19MC
icon
Related questions
Question

Please answer the following in SQL:

Find all pairs of customers who have purchased the exact same combination of cookie flavors. For example, customers with ID 1 and 10 have each purchased at least one Marzipan cookie and neither customer has purchased any other flavor of cookie. Report each pair of customers just once, sort by the numerically lower customer ID. The MySQL-specific GROUP_CONCAT and JSON_ARRAYAGG functions are not permitted.
 
customers dataset
CId: unique identifier of the customer
LastName: last name of the customer
FirstName: first name of the customer
 
goods dataset
GId: unique identifier of the baked good
Flavor: flavor/type of the good (e.g., "chocolate", "lemon")
Food: category of the good (e.g., "cake", "tart")
Price: price (in dollars) 
 
items dataset
Receipt : receipt number 
Ordinal : position of the purchased item on the
              receipts. (i.e., first purchased item,
              second purchased item, etc...)
Item : identifier of the item purchased (see goods.Id)
 
reciepts dataset
RNumber : unique identifier of the receiipt
SaleDate : date of the purchase. 
Customer : id of the customer (see customers.Id)
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Please read the instrucitons before posting an answer that someone else has already posted. GROUP_CONCAT is not permitted.

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Intermediate SQL concepts
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
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
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning