-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjogosBD
More file actions
32 lines (26 loc) · 706 Bytes
/
jogosBD
File metadata and controls
32 lines (26 loc) · 706 Bytes
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
31
32
-- Verificar dados da tabela
select * from jogos;
-- Criação da tabela
create table jogos (
idJogos bigint not null
generated always as identity (start with 1, increment by 1),
timeA varchar(20) not null,
golsA integer not null,
timeB varchar(20) not null,
golsB integer not null,
primary key (idJogos)
);
-- Colocação de dados na tabela
insert into jogos(timeA,golsA,timeB,golsB)
values('Corinthians',2,'São Paulo',1);
insert into jogos(timeA,golsA,timeB,golsB)
values('Palmeiras',1,'Flamengo',1);
-- Atualização de dados
update jogos
set golsA = 3
where idJogos = 1;
update jogos
set timeB = 'Gremio'
where idJogos = 2;
-- Deletar dados
delete from jogos where idJogos = 1;