-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathscript.sql
30 lines (25 loc) · 790 Bytes
/
script.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
create sequence Transacao_SEQ start with 1 increment by 50;
create UNLOGGED table Transacao (
id bigint not null,
valor integer,
clienteId bigint not null,
realizada_em timestamp(6),
descricao varchar(255),
tipo varchar(255),
primary key (id)
);
create UNLOGGED table Cliente (
id bigint not null,
limite bigint,
saldo bigint,
primary key (id)
);
CREATE INDEX ix_transacao_idcliente ON transacao
(
clienteId
);
insert into Cliente (limite, saldo, id) values (100000, 0, 1);
insert into Cliente (limite, saldo, id) values (80000, 0, 2);
insert into Cliente (limite, saldo, id) values (1000000, 0, 3);
insert into Cliente (limite, saldo, id) values (10000000, 0, 4);
insert into Cliente (limite, saldo, id) values (500000, 0, 5);