kea-semester-1 / best-bank-as

0 stars 0 forks source link

Database diagram #2

Open Moshizzl3 opened 1 year ago

Moshizzl3 commented 1 year ago

Conecptua/logical model, first draft


---
title: Bank example
---
erDiagram
    User {
        int user_id pk
        datetime created_at

        }
    Customer{
        int customer_id pk
        int user_id fk
        string phone_number
        int customer_level_id fk
        datetime created_at
    }

    Account{
        int account_id pk
        int account_number
        int customer_id fk
        datetime created_at

    }

    TransactionTable{
        int transaction_id pk

    }

    Ledger{
        int transaction_id fk
        int account_number fk
        decimal amount
        datetime created_at

    }

   AccountType {
    int account_type_id pk
    string account_type_name
    datetime created_at
    }

    CustomerLevel{
        int customer_level_id pk
        string customer_level_name
        datetime created_at
    }

    User |o--o| Customer : can_be
    Customer |o--o| CustomerLevel : has
    Customer |o--o{ Account : has
    Account |o--o| AccountType : can_be
    Ledger |o--o{ Account : has
    Ledger |o--o{ Account : has
    Ledger |o--o{ TransactionTable : has_
Moshizzl3 commented 1 year ago

Our ER diagram looks like this now:

image
Moshizzl3 commented 1 year ago

update:

image