100 % || INTUITIVE & Well - Defined || SQL QUERY || AGGREGATION || Beats 98.95 % || Efficient.......
Intuition\n Describe your first thoughts on how to solve this problem. \nSELECT customer_id --> Show customer_id from Customer Table...\nFROM Customer --> Assoc
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nSELECT customer_id --> Show customer_id from Customer Table...\nFROM Customer --> Association from Customer Table...\nGROUP BY customer_id --> Grouping w.r.t. customer_id...\nHAVING COUNT(DISTINCT product_key) = (SELECT COUNT(product_key) --> Using Aggregation function COUNT to count product_key firstly for Customer Table then finally for Product Table & Check either they are equal or not equal...? if equal then consider...(Condition given in the problem)...\n# Approach\n<!-- Describe your approach to solving the problem. -->\nUsing Fundamentals of SQL...\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nSELECT customer_id \nFROM Customer \nGROUP BY customer_id \nHAVING COUNT(DISTINCT product_key) = (SELECT COUNT(product_key) \nFROM Product);\n```
['Database', 'MySQL']