Exchange Rates

Exchange rates per currency pair, used to convert monetary amounts consistently across assets and time.

Facts

Definitions

ColumnDescription
dateFactual reference to the date (links to Dates).
currency_pair_idCurrency pair (links to Currency Pairs, e.g. EURUSD, GBPUSD, EURCHF).
valueFact registered.

Sample & Implementation

A list of Exchange Rates
datecurrency_pair_idvalue
2025-01-0111.234
CREATE TABLE IF NOT EXISTS exchange_rates (
    date DATE NOT NULL,
    currency_pair_id INTEGER NOT NULL,
    value DOUBLE NOT NULL,
    FOREIGN KEY (date) REFERENCES dates(date),
    FOREIGN KEY (currency_pair_id) REFERENCES currency_pairs(id),
    PRIMARY KEY (date, currency_pair_id)
)

Data Format

Field

Type

The primary key is formed by constrainst on Dates and Currency Pairs:
PRIMARY KEY (date, currency_pair_id)

Dependencies

On this page

Star us on GitHub

If you enjoy this content and find it useful, give us a star on GitHub to show your support and stay updated with our latest improvements.