Your question is Sales by Payment Method: Total and Unique Customers. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Meta commerce analytics needs a payment-method summary for successful transactions processed across Meta Pay and related checkout methods. Write a PostgreSQL query that joins payment transactions to the payment-method dimension and produces one row per payment method.
status = 'completed'.COUNT(DISTINCT ...).| Column | Type | Description |
|---|---|---|
| method_idPK | INT | Unique payment method identifier |
| method_name | VARCHAR(50) | Payment method display name |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment transaction identifier |
| customer_id | INT | Customer identifier, nullable for anonymous transactions |
| method_id | INT | Referenced payment method identifier |
| amount | NUMERIC(10,2) | Transaction amount |
| status | VARCHAR(20) | Payment processing status |