playground explore freely · no grades
SQL Playground
Explore any Runtime dataset with SQL. Nothing here affects course progress.
Six months of a fictional bank: customers, checking, savings and credit-card accounts, cards, merchants, card authorizations and settlements, refunds, disputes and the account ledger.
169,823 rows9 tables2025-01 – 2025-06
tables
Open a table to see what one row means, its columns and keys, and a preview. Start from transactions: it is the dataset's central table.
customers1,120 rows · 7 columns
One fictional retail-banking customer.
- customer_id
Customer key
- full_name
Fictional name
- city
Home city
- state
Home state
- date_of_birth
Date of birth
- customer_since
Relationship start date
- risk_tier
low, medium or high (internal credit-risk tier)
accounts2,109 rows · 7 columns
One deposit or credit-card account owned by one customer.
- account_id
Account key
- customer_id
Owner
- account_type
checking, savings or credit_card
- opened_at
Opening date
- closed_at
Closing date; NULL while open
- credit_limit_cents
Credit limit for credit cards; NULL for deposit accounts
- opening_balance_cents
Ledger balance at 2025-01-01 00:00 (or 0 if opened later); credit-card balances owed are negative
cards1,774 rows · 8 columns
One payment card. Lost or expired cards are replaced by a new card on the same account.
- card_id
Card key
- account_id
Funding account (checking for debit, credit_card for credit)
- card_type
debit or credit
- network
visa, mastercard or amex
- last4
Last four digits
- issued_at
Issue date
- expires_on
Expiry date
- status
active, lost, expired or frozen
merchants1,014 rows · 6 columns
One card-accepting merchant location.
- merchant_id
Merchant key
- merchant_name
Fictional merchant name
- category
Merchant category
- mcc
ISO 18245 merchant category code
- city
City
- country
ISO country code
authorizations40,508 rows · 10 columns
One card authorization request. The same request can appear more than once when the network retries.
- authorization_id
Authorization key
- request_key
Merchant request id; a retried request reuses it
- card_id
Card presented
- merchant_id
Merchant
- requested_at
Request time (UTC)
- amount
Requested amount in the transaction currency
- currency
USD, EUR, GBP, CAD or MXN
- channel
in_store, online or recurring
- status
approved or declined
- decline_reason
insufficient_funds, credit_limit, suspected_fraud, expired_card or card_frozen; NULL when approved
settlements37,071 rows · 4 columns
One completed card purchase. The final amount can differ from the authorization (tips, hotels, currency conversion).
- settlement_id
Settlement key
- authorization_id
Authorization being cleared
- settled_at
Clearing time (UTC)
- amount_cents
Cleared amount in US cents
refunds1,230 rows · 5 columns
One merchant refund against a settlement; a settlement can have several partial refunds.
- refund_id
Refund key
- settlement_id
Settlement refunded
- refunded_at
Refund time (UTC)
- amount_cents
Refunded US cents (positive)
- reason
returned_item, price_adjustment, canceled_service or duplicate_charge
chargebacks199 rows · 7 columns
One cardholder dispute against a settlement.
- chargeback_id
Dispute key
- settlement_id
Disputed settlement
- opened_at
Dispute opened (UTC)
- amount_cents
Disputed US cents
- reason_code
fraud, not_received, not_as_described or duplicate
- status
credited (cardholder won), rejected or open
- resolved_at
Resolution time; NULL while open
transactions84,798 rows · 12 columns
One money movement on an account. Negative amounts are money out. Pending entries have no posted time yet.
- transaction_id
Ledger entry key
- account_id
Account
- transaction_type
Kind of money movement (purchase, refund, transfer, fee, and similar)
- status
posted, pending or reversed
- amount_cents
Signed US cents
- initiated_at
When the movement started (UTC)
- posted_at
When it reached the ledger; NULL while pending or after reversal
- description
Statement description
- merchant_id
Merchant for card and bill entries
- authorization_id
Card authorization for card purchases
- refund_id
Refund credited
- chargeback_id
Dispute credited
relationships
How to join these tables. Left column matches the right column.
- accounts.customer_id joins to customers.customer_id
- cards.account_id joins to accounts.account_id
- authorizations.card_id joins to cards.card_id
- authorizations.merchant_id joins to merchants.merchant_id
- settlements.authorization_id joins to authorizations.authorization_id
- refunds.settlement_id joins to settlements.settlement_id
- chargebacks.settlement_id joins to settlements.settlement_id
- transactions.account_id joins to accounts.account_id
- transactions.merchant_id joins to merchants.merchant_id
- transactions.authorization_id joins to authorizations.authorization_id
- transactions.refund_id joins to refunds.refund_id
- transactions.chargeback_id joins to chargebacks.chargeback_id