Back to problems

Follow-Up Airpod Percentage

SQL · Apple · Easy

We have a transactions table that records every product purchase. Each row captures a single transaction. Table: transactions transaction_id is the primary key. Write a SQL query that computes the percentage of customers who bought AirPods on or after the day they bought an iPhone. The base population is the set of distinct customers who purchased an iPhone. You can assume the table contains at least one iPhone purchase, so the denominator will never be zero. Output this…

Checking your access…