Skip to content

Commit 6e23834

Browse files
committed
Corrige dados.sql
1 parent 1704d3e commit 6e23834

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dados.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
-- Área por estado: https://pt.wikipedia.org/wiki/Lista_de_unidades_federativas_do_Brasil_por_área
44
-- População por estado (prévio censo 2022): https://pt.wikipedia.org/wiki/Lista_de_unidades_federativas_do_Brasil_por_população
55

6-
drop table if exists cliente;
7-
drop table if exists funcionario;
8-
drop table if exists loja;
96
drop table if exists item_venda;
107
drop table if exists venda;
8+
9+
drop table if exists cliente;
10+
drop table if exists funcionario;
1111
drop table if exists estoque;
1212
drop table if exists produto;
1313
drop table if exists marca;
1414

15+
drop table if exists loja;
1516
drop table if exists cidade;
1617
drop table if exists estado;
1718
drop table if exists regiao_geografica;
@@ -147,15 +148,15 @@ END;
147148
$$ LANGUAGE 'plpgsql';
148149

149150

150-
CREATE OR REPLACE TRIGGER diminui_estoque_trigger
151+
CREATE TRIGGER diminui_estoque_trigger
151152
AFTER INSERT ON item_venda
152153
FOR EACH ROW EXECUTE PROCEDURE diminui_estoque_func();
153154

154-
CREATE OR REPLACE TRIGGER devolve_estoque_trigger
155+
CREATE TRIGGER devolve_estoque_trigger
155156
AFTER DELETE ON item_venda
156157
FOR EACH ROW EXECUTE PROCEDURE devolve_estoque_func();
157158

158-
CREATE OR REPLACE TRIGGER atualiza_estoque_trigger
159+
CREATE TRIGGER atualiza_estoque_trigger
159160
AFTER UPDATE ON item_venda
160161
FOR EACH ROW EXECUTE PROCEDURE atualiza_estoque_func();
161162

0 commit comments

Comments
 (0)