Changes between Version 1 and Version 2 of WikiStart/DB


Ignore:
Timestamp:
03/22/25 14:59:40 (2 months ago)
Author:
203206
Comment:

ddl code

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart/DB

    v1 v2  
    11= Релациона шема
     2
     3== DLL код
     4
     5{{{
     6create table account(
     7    id serial primary key,
     8        username varchar(255) not null,
     9        password varchar(255) not null,
     10        balance decimal(15, 2) not null
     11);
     12
     13create table "transaction"(
     14    id serial primary key,
     15        amount decimal(15, 2) not null,
     16        type varchar(50) not null,
     17        timestamp timestamp default current_timestamp,
     18        account_id int not null,
     19        foreign key (account_id) references account(id)
     20);
     21
     22create table deposit(
     23    id serial primary key,
     24        account_id int not null,
     25        amount decimal(15,2) not null,
     26        timestamp timestamp default current_timestamp,
     27        foreign key(account_id) references account(id)
     28);
     29
     30create table withdraw(
     31    id serial primary key,
     32        account_id int not null,
     33        amount decimal(15,2) not null,
     34        timestamp timestamp default current_timestamp,
     35        foreign key(account_id) references account(id)
     36);
     37
     38create table transferred_money(
     39        id serial primary key,
     40        s_account_id int not null,
     41        r_account_id int not null,
     42        t_id int not null,
     43        currency varchar(50) not null,
     44        foreign key (s_account_id) references account(id),
     45        foreign key (r_account_id) references account(id),
     46        foreign key (t_id) references transaction(id)
     47);
     48
     49
     50}}}