Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Arquivo Notas.csv correto

Estava tendo problemas para importar o arquivo Notas.csv e o erro está na formatação nos campos de data e o numérico ao utilizar virgula em vez de ponto. Também está trocada a ordem que professor colocou. Corrigi o arquivo e espero que seja útil.

NUMERO,DATA_VENDA,CPF,MATRICULA,IMPOSTO
100,2015-01-01,7771579779,235,0.1
101,2015-01-01,50534475787,237,0.12
102,2015-01-01,8502682733,236,0.12
103,2015-01-01,5840119709,235,0.12
104,2015-01-01,1471156710,235,0.12
105,2015-01-01,94387575700,236,0.1
106,2015-01-01,3623344710,237,0.1
107,2015-01-01,5576228758,236,0.1
108,2015-01-01,19290992743,237,0.12
109,2015-01-01,94387575700,236,0.12
110,2015-01-01,5840119709,235,0.12
111,2015-01-01,492472718,237,0.1
112,2015-01-01,5840119709,236,0.12
113,2015-01-01,50534475787,235,0.1
114,2015-01-01,94387575700,235,0.1
115,2015-01-01,94387575700,236,0.12
116,2015-01-01,50534475787,235,0.1
117,2015-01-01,8719655770,236,0.12
118,2015-01-01,2600586709,235,0.12
119,2015-01-01,3623344710,236,0.1
120,2015-01-01,3623344710,235,0.1
121,2015-01-01,3623344710,235,0.12
122,2015-01-01,5648641702,237,0.1
123,2015-01-01,50534475787,237,0.12
124,2015-01-01,94387575700,235,0.12
125,2015-01-01,5840119709,237,0.12
126,2015-01-01,7771579779,237,0.12
127,2015-01-01,8502682733,236,0.12
128,2015-01-01,5648641702,237,0.12
129,2015-01-01,5840119709,237,0.12
130,2015-01-01,5576228758,236,0.12
131,2015-01-01,5840119709,236,0.12
132,2015-01-01,5576228758,236,0.1
133,2015-01-01,5576228758,235,0.12
134,2015-01-01,1471156710,235,0.12
135,2015-01-01,5648641702,235,0.12
136,2015-01-01,50534475787,236,0.1
137,2015-01-01,19290992743,237,0.12
138,2015-01-01,5648641702,235,0.1
139,2015-01-01,50534475787,236,0.1
140,2015-01-01,2600586709,237,0.12
141,2015-01-01,8502682733,237,0.1
142,2015-01-01,3623344710,236,0.1
143,2015-01-01,8719655770,236,0.12
144,2015-01-01,50534475787,236,0.12
145,2015-01-01,19290992743,235,0.1
146,2015-01-01,5648641702,236,0.12
147,2015-01-01,492472718,236,0.12
148,2015-01-01,492472718,236,0.1
149,2015-01-01,94387575700,235,0.12
150,2015-01-01,9283760794,236,0.12
151,2015-01-01,8719655770,235,0.1
152,2015-01-01,19290992743,237,0.1
153,2015-01-01,5576228758,237,0.12
154,2015-01-01,50534475787,237,0.1
155,2015-01-01,8502682733,237,0.1
156,2015-01-01,2600586709,237,0.1
157,2015-01-01,94387575700,235,0.1
158,2015-01-01,5840119709,236,0.1
159,2015-01-01,7771579779,237,0.12
160,2015-01-01,2600586709,236,0.1
161,2015-01-01,5576228758,235,0.1
162,2015-01-01,5840119709,235,0.12
163,2015-01-01,7771579779,235,0.1
164,2015-01-01,8502682733,235,0.1
165,2015-01-01,1471156710,235,0.1
166,2015-01-01,8502682733,237,0.1
167,2015-01-01,5576228758,235,0.1
168,2015-01-01,5576228758,235,0.1
169,2015-01-01,5840119709,237,0.12
170,2015-01-01,5840119709,237,0.12
2 respostas

Perfeito.

solução!

Com esse comando você pode criar a Tabela notas e inserir os valores.

USE vendas_sucos;

CREATE TABLE `notas` (
  `CPF` varchar(11) NOT NULL,
  `MATRICULA` varchar(50) NOT NULL,
  `DATA_VENDA` date DEFAULT NULL,
  `NUMERO` int NOT NULL,
  `IMPOSTO` float NOT NULL,
  PRIMARY KEY (`NUMERO`),
  KEY `MATRICULA` (`MATRICULA`),
  KEY `CPF` (`CPF`),
  CONSTRAINT `notas_ibfk_1` FOREIGN KEY (`MATRICULA`) REFERENCES `vendedores` (`MATRICULA`),
  CONSTRAINT `notas_ibfk_2` FOREIGN KEY (`CPF`) REFERENCES `clientes` (`CPF`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

INSERT INTO NOTAS (NUMERO,DATA_VENDA,CPF,MATRICULA,IMPOSTO)

VALUES (100,'2015-01-01',7771579779,235,0.1),
(101,'2015-01-01',50534475787,237,0.12),
(102,'2015-01-01',8502682733,236,0.12),
(103,'2015-01-01',5840119709,235,0.12),
(104,'2015-01-01',1471156710,235,0.12),
(105,'2015-01-01',94387575700,236,0.1),
(106,'2015-01-01',3623344710,237,0.1),
(107,'2015-01-01',5576228758,236,0.1),
(108,'2015-01-01',19290992743,237,0.12),
(109,'2015-01-01',94387575700,236,0.12),
(110,'2015-01-01',5840119709,235,0.12),
(111,'2015-01-01',492472718,237,0.1),
(112,'2015-01-01',5840119709,236,0.12),
(113,'2015-01-01',50534475787,235,0.1),
(114,'2015-01-01',94387575700,235,0.1),
(115,'2015-01-01',94387575700,236,0.12),
(116,'2015-01-01',50534475787,235,0.1),
(117,'2015-01-01',8719655770,236,0.12),
(118,'2015-01-01',2600586709,235,0.12),
(119,'2015-01-01',3623344710,236,0.1),
(120,'2015-01-01',3623344710,235,0.1),
(121,'2015-01-01',3623344710,235,0.12),
(122,'2015-01-01',5648641702,237,0.1),
(123,'2015-01-01',50534475787,237,0.12),
(124,'2015-01-01',94387575700,235,0.12),
(125,'2015-01-01',5840119709,237,0.12),
(126,'2015-01-01',7771579779,237,0.12),
(127,'2015-01-01',8502682733,236,0.12),
(128,'2015-01-01',5648641702,237,0.12),
(129,'2015-01-01',5840119709,237,0.12),
(130,'2015-01-01',5576228758,236,0.12),
(131,'2015-01-01',5840119709,236,0.12),
(132,'2015-01-01',5576228758,236,0.1),
(133,'2015-01-01',5576228758,235,0.12),
(134,'2015-01-01',1471156710,235,0.12),
(135,'2015-01-01',5648641702,235,0.12),
(136,'2015-01-01',50534475787,236,0.1),
(137,'2015-01-01',19290992743,237,0.12),
(138,'2015-01-01',5648641702,235,0.1),
(139,'2015-01-01',50534475787,236,0.1),
(140,'2015-01-01',2600586709,237,0.12),
(141,'2015-01-01',8502682733,237,0.1),
(142,'2015-01-01',3623344710,236,0.1),
(143,'2015-01-01',8719655770,236,0.12),
(144,'2015-01-01',50534475787,236,0.12),
(145,'2015-01-01',19290992743,235,0.1),
(146,'2015-01-01',5648641702,236,0.12),
(147,'2015-01-01',492472718,236,0.12),
(148,'2015-01-01',492472718,236,0.1),
(149,'2015-01-01',94387575700,235,0.12),
(150,'2015-01-01',9283760794,236,0.12),
(151,'2015-01-01',8719655770,235,0.1),
(152,'2015-01-01',19290992743,237,0.1),
(153,'2015-01-01',5576228758,237,0.12),
(154,'2015-01-01',50534475787,237,0.1),
(155,'2015-01-01',8502682733,237,0.1),
(156,'2015-01-01',2600586709,237,0.1),
(157,'2015-01-01',94387575700,235,0.1),
(158,'2015-01-01',5840119709,236,0.1),
(159,'2015-01-01',7771579779,237,0.12),
(160,'2015-01-01',2600586709,236,0.1),
(161,'2015-01-01',5576228758,235,0.1),
(162,'2015-01-01',5840119709,235,0.12),
(163,'2015-01-01',7771579779,235,0.1),
(164,'2015-01-01',8502682733,235,0.1),
(165,'2015-01-01',1471156710,235,0.1),
(166,'2015-01-01',8502682733,237,0.1),
(167,'2015-01-01',5576228758,235,0.1),
(168,'2015-01-01',5576228758,235,0.1),
(169,'2015-01-01',5840119709,237,0.12),
(170,'2015-01-01',5840119709,237,0.12);

SELECT * FROM notas;