Your question is Second-Highest Marketplace Transactions User. 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 Marketplace wants to identify the user with the second-highest number of completed transactions. Write a SQL query to return that user.
status = 'completed'.user_id, user_name, and completed_transaction_count in the output.user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Primary key for the user |
| user_name | VARCHAR(100) | Meta Marketplace user name |
| region | VARCHAR(50) | User region |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Primary key for the transaction |
| user_id | INT | User who initiated the transaction |
| amount | DECIMAL(10,2) | Transaction amount |
| status | VARCHAR(20) | Transaction status |
| transaction_date | DATE | Date of the transaction |