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)
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)
Chapter12: Subqueries And Merge Statements
Section: Chapter Questions
Problem 19MC
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
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")
Flavor: flavor/type of the good (e.g., "chocolate", "lemon")
Food: category of the good (e.g., "cake", "tart")
Price: price (in dollars)
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)
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)
SaleDate : date of the purchase.
Customer : id of the customer (see customers.Id)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
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
by Bartleby Expert
Knowledge Booster
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.Recommended textbooks for you
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
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
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
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…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning