Back to problems

Write SQL for dedup and purchase shares

SQL · Cvs Health · Medium

You are given a pair of tables that deliberately hold repeated rows. The users table can list the same user_id more than once (for instance, the same individual was captured under two slightly different spellings), and the purchases table can record the same order_id more than once. Your submitted PostgreSQL query is a single statement that solves Part 3 below; Parts 1 and 2 are separate queries you should also be able to write, but only the Part 3 result set is executed and…

Checking your access…