FinSight Analytics stores normalized financial statement line items in a single table. A common first step in analysis is summarizing statement values by statement type.
Write a SQL query to calculate the total amount for each statement_type for company Apex Retail in fiscal year 2023.
company_name = 'Apex Retail' and fiscal_year = 2023statement_type and the summed amount as total_amounttotal_amount in descending order| column_name | type | description |
|---|---|---|
| id | INT | Unique row identifier |
| company_name | VARCHAR(100) | Company name |
| statement_type | VARCHAR(50) | Financial statement category such as Income Statement or Balance Sheet |
| line_item | VARCHAR(100) | Specific metric name |
| fiscal_year | INT | Reporting year |
| amount | DECIMAL(14,2) | Reported amount |
| id | company_name | statement_type | line_item | fiscal_year | amount |
|---|---|---|---|---|---|
| 1 | Apex Retail | Income Statement | Revenue | 2023 | 1250000.00 |
| 2 | Apex Retail | Income Statement | Operating Expense | 2023 | -420000.00 |
| 3 | Apex Retail | Balance Sheet | Cash | 2023 | 180000.00 |
| 4 | Apex Retail | Cash Flow Statement | Operating Cash Flow | 2023 | 210000.00 |
| 5 | Beacon Health | Income Statement | Revenue | 2023 | 980000.00 |
| 6 | Apex Retail | Income Statement | Net Income | 2022 | 95000.00 |
| statement_type | total_amount |
|---|---|
| Income Statement | 740000.00 |
| Cash Flow Statement | 210000.00 |
| Balance Sheet | 150000.00 |
| Column | Type | Description |
|---|---|---|
| idPK | INT | Unique row identifier |
| company_name | VARCHAR(100) | Company name |
| statement_type | VARCHAR(50) | Financial statement category |
| line_item | VARCHAR(100) | Specific financial line item |
| fiscal_year | INT | Reporting fiscal year |
| amount | DECIMAL(14,2) | Reported amount for the line item |
| id | company_name | statement_type | line_item | fiscal_year | amount |
|---|---|---|---|---|---|
| 1 | Apex Retail | Balance Sheet | Inventory | 2023 | -30000.00 |
| 2 | Beacon Health | Income Statement | Revenue | 2023 | 980000.00 |
| 3 | Apex Retail | Income Statement | Revenue | 2023 | 1250000.00 |
| 4 | Apex Retail | Cash Flow Statement | Operating Cash Flow | 2023 | 210000.00 |
| 5 | Apex Retail | Balance Sheet | Cash | 2023 | 180000.00 |
| 6 | Apex Retail | Income Statement | Operating Expense | 2023 | -420000.00 |
| 7 | Apex Retail | Income Statement | Net Income | 2022 | 95000.00 |
| 8 | Apex Retail | Balance Sheet | Accounts Payable | 2023 | 0.00 |
| 9 | Apex Retail | Cash Flow Statement | Financing Cash Flow | 2023 | |
| 10 | Apex Retail | Income Statement | Interest Expense | 2023 | -15000.00 |
| 11 | Crest Energy | Balance Sheet | Cash | 2023 | 450000.00 |
| 12 | Apex Retail | Balance Sheet | Receivables | 2022 | 90000.00 |
| 13 | Vertex Education | Funding Statement | null | 2023 | 392964 |
| 14 | Zenith Hospitality | Cash Flow Statement | Operating Expense | 2023 | null |
| 15 | Apex Retail | Capital Report | Revenue | 2023 | -136598 |
| 16 | Pioneer Insurance | Capital Report | Operating Expense | 2023 | 1132086 |
| 17 | Titan Industrial | Cash Flow Statement | Current Assets | 2022 | 1000337 |
| 18 | Lumen Software | Earnings Summary | Operating Expense | 2022 | 378645 |
| 19 | Northstar Pharma | Annual Statement | Inventory | 2022 | -63036 |
| 20 | Lumen Software | Segment Report | Other Expense | 2023 | 1138057 |
| 21 | Pioneer Insurance | Treasury Report | Goodwill | 2023 | 671784 |
| 22 | Falcon Media | Liquidity Report | Capital Expenditure | 2023 | 84329 |
| 23 | Keystone Apparel | Notes Disclosure | EBITDA | 2023 | 1346615 |
| 24 | Oakridge Manufacturing | Tax Statement | Investing Cash Flow | 2023 | -435379 |
| 25 | Vertex Education | Consolidated Statement | Cost of Goods Sold | 2023 | null |
| statement_type | total_amount |
|---|---|
| Income Statement | 815000.00 |
| Cash Flow Statement | 210000.00 |
| Balance Sheet | 150000.00 |
| Capital Report | -136598.00 |