Model the data.
Company dimension, financial fact table, foreign keys, a composite company/year/period key and input constraints.
A focused SQL example comparing H1 2025 and H1 2026 company financial inputs from my research.
| Company | Currency | Revenue growth | FCF growth | CapEx / OCF |
|---|---|---|---|---|
| BUA Cement | NGN | 25.61% | 61.95% | 21.79% |
| BUA Foods | NGN | -16.15% | 71.86% | 9.72% |
| Dangote Cement | NGN | 21.34% | -0.88% | 33.54% |
| Alphabet | USD | 23.05% | -82.43% | 94.98% |
Percentages calculated from the included rounded inputs. Amounts are in millions of each reporting currency; the query does not aggregate across currencies.
Company dimension, financial fact table, foreign keys, a composite company/year/period key and input constraints.
A CTE, a company join and LAG window functions calculate year-on-year changes within company and fiscal period.
Foreign-key, row-count and period-coverage assertions, plus an independent check on the Alphabet growth figures.
unzip financial-sql.zip cd financial-sql python run.py
Python standard library only. The archive includes the source CSVs, SQL schema, query, runner, results and README. This is a small financial-analysis example, not a large-scale data pipeline.
New portfolio extension prepared with ChatGPT assistance from my existing research inputs. Financial inputs have not been re-audited against primary filings in this example.
Download SQL project ↓