advancedTop 15 Database Design Questions

Design a financial transaction system supporting multiple currencies and audit compliance.

accounts(id, user_id FK, currency CHAR(3), balance DECIMAL(18,4), version INT) — @Version for optimistic locking transactions(id UUID PK, from_account_id FK, to_account_id FK, amount DECIMAL(18,4), currency, exchange_rate, status, created_at, idempotency_key UUID UNIQUE) transaction_entries(id, transaction_id FK, account_id FK, debit_amount, credit_amount, created_at) — double-entry bookkeeping au

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Design a product catalog with complex variable attributes (electronics, clothing, furniture).← Back to all SQL questions