forked from manoelcampos/java-postgres-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsefaz.sql
54 lines (46 loc) · 1.32 KB
/
sefaz.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- Active: 1690746463990@@127.0.0.1@5432@postgres
drop table if exists Xvendedor;
drop table if exists Xproduto;
drop table if exists Xvendas;
CREATE TABLE Xvendedor (
nome VARCHAR (100) NOT NULL
);
CREATE TABLE Xproduto (
tipo VARCHAR (100) NOT NULL,
valor FLOAT
);
CREATE TABLE Xvendas (
nome VARCHAR (100) NOT NULL,
tipo VARCHAR (100) NOT NULL,
quantidade INT
);
INSERT INTO Xvendedor (nome)
VALUES ('Gabriela');
INSERT INTO Xvendedor (nome)
VALUES ('Joao');
INSERT INTO Xvendedor (nome)
VALUES ('Maria');
INSERT INTO Xvendedor (nome)
VALUES ('Pedro');
INSERT INTO Xproduto (tipo, valor)
VALUES ('Cadeira',800.0);
INSERT INTO Xproduto (tipo, valor)
VALUES ('Mesa',1400.0);
INSERT INTO Xproduto (tipo, valor)
VALUES ('Sofa',2600.0);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Gabriela','Cadeira',8);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Gabriela','Mesa',2);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Gabriela','Sofa',3);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Joao','Cadeira',4);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Joao','Mesa',1);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Joao','Sofa',3);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Maria','Cadeira',2);
INSERT INTO Xvendas (nome,tipo, quantidade)
VALUES ('Maria','Mesa',1);