All Questions
Next Question
Top Buyer and Seller
00:00:00
Parts
Part 1
Write a SQL query to find the trader who bought and sold the most META stock in the past 30 days. Allow for ties and return the answer ordered by total transactions in descending order.
You are given the following table called transactions_table
Column Name | Data Type |
---|---|
transaction_date | datetime |
stock_symbol | text |
buyer_id | bigint |
seller_id | bigint |
transaction_id | bigint |
purchase_price | float |
Here is an example of how the output should look:
trader_id | transactions |
---|---|
12345 | 85 |