SQL
Greek Banking Analysis
Initializing sql.js WebAssembly...
🏠 Αρχική Σελίδα 📄 CV 🌱 Agroprotasis AI 🍅 Tomato QC GitHub
Spyros Papastergiou | phytai.com
G
Greek Banking Sector Analysis
Eurobank · Alpha Bank · Piraeus · NBG · 2022–2024
SQLite LIVE
Greek Banking Sector 2022–2024
Data loaded live from greek_banking_final.db · 12 annual reports of the four listed groups (Alpha Services and Holdings, Eurobank Ergasias Services and Holdings, National Bank of Greece, Piraeus Financial Holdings) · every number traced to a PDF page · Python + pdfplumber → SQLite → sql.js
PDF Extraction Python ETL SQLite sql.js WASM
Live SQL query · running in your browser via sql.js WebAssembly
SELECT bank, nii, net_profit, roe, cost_to_income, loan_to_deposit, nim, total_assets, nii_yoy, profit_yoy FROM kpis WHERE year = 2024 ORDER BY nii DESC -- greek_banking_final.db
Sector NII
—
Selected banks · combined
Total Assets
—
Selected banks · year end
Net Profit
—
Attributable to shareholders
Avg ROE
—
Simple average · on average equity
Eurobank
NII
—
Net Profit
—
ROE
—
Cost/Income
—
Alpha Bank
NII
—
Net Profit
—
ROE
—
Cost/Income
—
Piraeus Bank
NII
—
Net Profit
—
ROE
—
Cost/Income
—
NBG
NII
—
Net Profit
—
ROE
—
Cost/Income
—
NII
—
C/I
—
TA
—
CoR
—
Net Interest Income — 3-Year Trend
SELECT bank, year, nii FROM kpis ORDER BY year
—
Share of Total Assets 2024
SELECT bank, total_assets FROM kpis WHERE year=2024
—
Return on Equity
Net profit / average equity · SELECT bank, year, roe FROM kpis
Cost-to-Income Ratio
Lower = more efficient (axis reversed)
—
Net Profit
Attributable to shareholders · SELECT bank, year, net_profit FROM kpis
Profitability Matrix — ROE vs Cost-to-Income
Bubble area ∝ Total Assets · dotted lines = average of the four · SELECT bank, roe, cost_to_income, total_assets FROM kpis WHERE year=2024
2024 peer positions
Impairment Losses on Loans
FROM income_statement WHERE metric='Impairment losses on loans'
—
Cost of Risk — 3-Year Trend
Loan impairments / average loans · SELECT bank, year, cost_of_risk FROM kpis
Credit quality
Net Fee & Commission Income
FROM income_statement WHERE metric='Net banking fee and commission income'
—
Loans vs Deposits
FROM kpis — loans and advances vs customer deposits (€bn)
L/D year
Net Interest Margin — Trend
NII / average total assets · SELECT bank, year, nim FROM kpis
—
CET1 Capital Ratio — 3-Year Trend
SELECT bank, year, cet1 FROM kpis · as reported in each annual report
—
NPE Ratio — 3-Year Trend
SELECT bank, year, npe_ratio FROM kpis · as reported in each annual report
—
ECB Funding Paid Back
Amounts due to the ECB and central banks at year end · FROM ecb_funding
—
Eurobank — Earning Assets 2022→2024
Loans + investment securities + due from banks · FROM balance_sheet
—
Asset Composition
% of Total Assets · FROM balance_sheet WHERE year=2024
Loans · securities · cash
Funding Structure
% of Total Assets · FROM balance_sheet WHERE year=2024
Deposit-funded
Loan-to-Deposit Ratio
SELECT bank, loan_to_deposit FROM kpis WHERE year=2024
—
KPI Rankings
SELECT * FROM kpis WHERE year=2024 ORDER BY nii DESC
BankNIIROE%C/I%NIM%NPE%Assets
NIM comparison
3-Year KPI Evolution Heatmap (2022–2024)
5 metrics · 4 banks · 3 years · green = better, red = weaker across all 12 bank-years
Peer Benchmark
Analyst Commentary Every figure below is computed from the database on this page
Rates drove 2023, volumes drove 2024
Cost efficiency
Capital and its quality
The laggard
Returns and Capital FY2024 · no market prices are used · not investment advice
What the 2024 returns would justify
BankRoTE 2024RoTE − CoEJustified P/TBV
RoTE = net profit / average tangible equity (equity attributable − AT1 − goodwill and intangibles). Justified P/TBV = (RoTE − g) / (CoE − g), with an assumed cost of equity of 10% and growth of 2% (the defaults of the Streamlit app). A bank that earns exactly its cost of equity is worth 1.0x tangible book value.
Official EBA 2023 stress test (fully loaded CET1)
BankDec 2022Adverse 2025DepletionSource
Results as published in each bank's FY2023 annual report. The EBA scenario runs three years from a static balance sheet at end-2022.
How the numbers are checked Look up the report and page of any figure
    LineValueReport and page
    About This Project
    An end-to-end financial data pipeline built from scratch, with no pre-cleaned datasets. The income statements and balance sheets come straight from the annual report PDFs of the four listed Greek banking groups; each year is taken from the latest report that contains it, so every comparison uses the same basis. The data goes through a Python ETL pipeline into SQLite and is queried here with sql.js, live in your browser.
    1
    PDF Source
    Annual reports FY2022–FY2024
    12 PDFs · 4 groups
    2
    Python Extract
    Statement pages · line rules
    pdfplumber · regex
    3
    pandas Build
    KPIs on average balances
    pandas · pytest
    4
    SQLite Load
    KPIs · statements · sources
    SQLite
    5
    SQL Analysis
    Window functions · YoY · KPIs
    LAG() · PARTITION BY
    6
    sql.js WASM
    Live queries in the browser
    sql.js · Plotly.js
    SQL — Window Function
    SELECT bank, year, nii,
      ROUND((nii - LAG(nii)
      OVER (PARTITION BY bank
      ORDER BY year)) * 100.0 /
      LAG(nii) OVER (...), 1)
      AS nii_yoy_pct
    FROM kpis
    Python — PDF Extraction
    with pdfplumber.open(pdf) as doc:
      lines = doc.pages[page - 1]
        .extract_text().splitlines()
    # find the statement line, keep the
    # two value columns and the page
    row = match(lines, "Net interest income")
    values = trailing_values(row, 2)
    SQL — ROE on Average Equity
    SELECT bank, year,
      ROUND(net_profit * 100.0 / ((equity +
        LAG(equity) OVER (PARTITION BY bank
        ORDER BY year)) / 2), 1) AS roe
    FROM kpis
    -- 2022 uses the end-2021 equity
    -- from the FY2022 reports