Easy Solution using Equality Operation
Intuition\n Describe your first thoughts on how to solve this problem. \nThe Question looks on a bit moderate side . It can be solved by step by step. \n\n---\n
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe Question looks on a bit moderate side . It can be solved by step by step. \n\n---\n\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nStep by Step Solution \n**Step 1 :**\nGet the distinct product keys of every user present in the customer table and equate it with the total product keys present in the product table .\nif equal then give the customer id otherwise NO\n```\nhaving count(distinct product_key) = (select count(distinct product_key)\n```\n\n---\nOnce we get the distinct product keys our problem is easily solved .\n# Code\n```\n# Write your MySQL query statement below\n#30-12-2023\nselect customer_id\nfrom customer \ngroup by customer_id \nhaving count(distinct product_key) = (select count(distinct product_key) from product)\n```
['Database', 'MySQL']