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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education