Question
Table Name: TRADES DATE FIRM SYMBOL SIDE QUANTITY PRICE 2/3/2014 1ABC A123 B 200 41 2/4/2014 2BCD B234 B 600 60 2/7/2014 1ABC C345 S
Table Name: TRADES
DATE | FIRM | SYMBOL | SIDE | QUANTITY | PRICE |
2/3/2014 | 1ABC | A123 | B | 200 | 41 |
2/4/2014 | 2BCD | B234 | B | 600 | 60 |
2/7/2014 | 1ABC | C345 | S | 600 | 70 |
2/10/2014 | 3CDE | C345 | S | 600 | 70 |
2/12/2014 | 4DEF | B234 | B | 200 | 62 |
2/14/2014 | 3CDE | B234 | B | 300 | 61 |
2/21/2014 | 1ABC | A123 | B | 300 | 40 |
2/24/2014 | 1ABC | A123 | S | 300 | 30 |
2/25/2014 | 4DEF | C345 | B | 2100 | 71 |
2/27/2014 | CDE | B234 | S | 1100 | 63 |
Q3. Your business user asks you to show them a table that includes the number of trades for each firm and symbol combination in the data table above. Please write the SQL query you would use to query TRADES table to get below result
FIRM | SYMBOL | NO_TRADES |
1ABC | A123 | 3 |
2BCD | B234 | 1 |
1ABC | C345 | 1 |
3CDE | C345 | 1 |
4DEF | B234 | 1 |
3CDE | B234 | 1 |
4DEF | C345 | 1 |
CDE | B234 | 1 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started