111 lines
5.7 KiB
YAML
111 lines
5.7 KiB
YAML
# Human-authored augmentation for the BIRD `financial` dataset.
|
|
#
|
|
# The warehouse STRUCTURE (tables/columns/types/nullability) is extracted
|
|
# from Postgres into extracted_schema.json by `make recon`. This file only
|
|
# carries what humans add on top: table/column descriptions and relationships.
|
|
# (Metrics live in metrics.yaml.)
|
|
#
|
|
# Format:
|
|
# tables.<name>: one-line description.
|
|
# columns.<table>.<col>: one-line description. Sparse — only the ones
|
|
# worth describing. Undescribed columns just have
|
|
# no description in the recon. A column may also
|
|
# carry a domain type, e.g.
|
|
# loan.date: {desc: "...", type: date_yymmdd}
|
|
# relationships: declared FKs (BIRD ships SQLite without them).
|
|
# encodings: OPTIONAL. Storage-encoding overrides keyed by a
|
|
# column's `type`. Each maps a role → SQL template
|
|
# with a `{col}` placeholder. The composer ships
|
|
# defaults (e.g. date_yymmdd); add an entry here only
|
|
# to introduce a novel encoding or override a default:
|
|
# encodings:
|
|
# date_yymmdd:
|
|
# as_date: "TO_DATE(LPAD({col}::text, 6, '0'), 'YYMMDD')"
|
|
# `financial` stores real DATE columns, so it needs none.
|
|
|
|
schema: financial
|
|
|
|
tables:
|
|
account: One row per bank account. The pivot table — most facts hang off account_id.
|
|
client: One row per bank customer.
|
|
disp: Disposition — many-to-many link between client and account. Type tells you whether the client is the OWNER or just a USER of the account.
|
|
district: Demographic and economic data for each Czech district. The A-columns are infamous — most analysis questions referencing demographics use these.
|
|
loan: One row per loan granted to an account.
|
|
card: One row per credit/debit card issued to a disposition.
|
|
trans: Transaction history. Largest table by far (~1M rows). Every credit, debit, transfer.
|
|
order: Standing payment orders (recurring debits). Note the table name collides with a SQL keyword and must be quoted.
|
|
|
|
columns:
|
|
account.district_id: Geographic district the account belongs to (joins to district).
|
|
account.frequency: Statement issuance frequency. "POPLATEK MESICNE" = monthly, "POPLATEK TYDNE" = weekly, "POPLATEK PO OBRATU" = on transaction.
|
|
account.date: Date the account was opened.
|
|
|
|
client.gender: '"M" or "F". Derived from birth_number.'
|
|
client.birth_date: Date of birth, normalised. Original birth_number encoded gender by adding 50 to the month field for women.
|
|
client.district_id: District the client lives in (joins to district).
|
|
|
|
disp.client_id: Joins to client.
|
|
disp.account_id: Joins to account.
|
|
disp.type: '"OWNER" or "DISPONENT" (USER). Only owners can request loans / cards.'
|
|
|
|
district.A2: District name.
|
|
district.A3: Region (a grouping of districts).
|
|
district.A4: Number of inhabitants.
|
|
district.A5: Number of municipalities with population < 499.
|
|
district.A6: Number of municipalities with population 500-1999.
|
|
district.A7: Number of municipalities with population 2000-9999.
|
|
district.A8: Number of municipalities with population > 10000.
|
|
district.A9: Number of cities.
|
|
district.A10: Ratio of urban inhabitants (percent).
|
|
district.A11: Average salary (in CZK).
|
|
district.A12: Unemployment rate in 1995 (percent). NULL means missing data.
|
|
district.A13: Unemployment rate in 1996 (percent).
|
|
district.A14: Number of entrepreneurs per 1000 inhabitants.
|
|
district.A15: Number of crimes committed in 1995. NULL means missing data.
|
|
district.A16: Number of crimes committed in 1996.
|
|
|
|
loan.account_id: The account the loan was granted to.
|
|
loan.date: Date the loan was granted.
|
|
loan.amount: Total amount of the loan (CZK).
|
|
loan.duration: Loan duration in months.
|
|
loan.payments: Monthly payment (CZK).
|
|
loan.status: Loan status code. "A" = contract finished, no problems. "B" = contract finished, loan not paid (DEFAULT). "C" = running contract, payments on time. "D" = running contract, client in debt (AT RISK).
|
|
|
|
card.disp_id: The disposition (and via it, the account) the card belongs to.
|
|
card.type: '"junior", "classic", or "gold".'
|
|
card.issued: Date the card was issued.
|
|
|
|
trans.account_id: The account the transaction belongs to.
|
|
trans.date: Transaction date.
|
|
trans.type: '"PRIJEM" (credit) or "VYDAJ" (debit).'
|
|
trans.operation: Mode of operation, e.g. "VKLAD" (cash credit), "VYBER" (cash withdrawal), "PREVOD Z UCTU" (transfer from another bank).
|
|
trans.amount: Amount (CZK).
|
|
trans.balance: Account balance after the transaction.
|
|
trans.k_symbol: Characterisation of the payment. "POJISTNE" = insurance, "SLUZBY" = household, "UROK" = interest credited, "SANKC. UROK" = penalty interest, "SIPO" = household payment, "DUCHOD" = old-age pension, "UVER" = loan payment.
|
|
trans.bank: Counterparty bank code (only set for inter-bank transfers).
|
|
trans.account: Counterparty account number (only set for inter-bank transfers).
|
|
|
|
order.account_id: The originating account.
|
|
order.bank_to: Recipient bank.
|
|
order.account_to: Recipient account.
|
|
order.amount: Order amount (CZK).
|
|
order.k_symbol: Purpose, same vocabulary as trans.k_symbol.
|
|
|
|
relationships:
|
|
- from: account.district_id
|
|
to: district.district_id
|
|
- from: client.district_id
|
|
to: district.district_id
|
|
- from: disp.client_id
|
|
to: client.client_id
|
|
- from: disp.account_id
|
|
to: account.account_id
|
|
- from: loan.account_id
|
|
to: account.account_id
|
|
- from: card.disp_id
|
|
to: disp.disp_id
|
|
- from: trans.account_id
|
|
to: account.account_id
|
|
- from: order.account_id
|
|
to: account.account_id
|