-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Tempo de geração: 29/01/2020 às 22:00
-- Versão do servidor: 8.0.19
-- Versão do PHP: 7.4.2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

-- --------------------------------------------------------

--
-- Estrutura para tabela `clientes`
--

CREATE TABLE `clientes` (
  `cod_cli` smallint NOT NULL,
  `nome` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `clientes`
--

INSERT INTO `clientes` (`cod_cli`, `nome`) VALUES
(1, 'Ana Carolina Rodrigues'),
(2, 'Posto Ipiranga'),
(3, 'Antônio Pires'),
(4, 'Ana Chaves'),
(5, 'Droga Raia'),
(6, 'José Oliveira'),
(7, 'Casas Pernambucanas'),
(8, 'Gabriel Silva dos Santos'),
(9, 'Tatiana Pereira da Silva'),
(10, 'Lojas Seller');

-- --------------------------------------------------------

--
-- Estrutura para tabela `contatos`
--

CREATE TABLE `contatos` (
  `cod_con` smallint NOT NULL,
  `cod_emp` smallint DEFAULT NULL,
  `cod_forn` smallint DEFAULT NULL,
  `cod_cli` smallint DEFAULT NULL,
  `logradouro` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `num_end` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `bairro` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cidade` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `uf` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cep` char(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ddd` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `num_tel` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `e_mail` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `contatos`
--

INSERT INTO `contatos` (`cod_con`, `cod_emp`, `cod_forn`, `cod_cli`, `logradouro`, `num_end`, `bairro`, `cidade`, `uf`, `cep`, `ddd`, `num_tel`, `e_mail`) VALUES
(1, NULL, NULL, 1, 'Rua Joaquim Procópio de Araújo', '271', 'Centro', 'Pirassununga', 'SP', '13630082', '19', '35015237', 'arodrigues@gmail.com'),
(2, NULL, NULL, 3, 'Rua Sebastião B. O. Alves', '156', 'Jardim Limoeiro', 'Pirassununga', 'SP', '13641043', '19', '35990389', 'antonio_pires@yahoo.com.br'),
(3, NULL, NULL, 4, 'Rua Reverendo Israel Vieira Pereira', '843', 'Jardim das Laranjeiras', 'Pirassununga', 'SP', '13635128', '19', '994599876', 'achaves@gmail.com'),
(4, NULL, NULL, 6, 'Rua Doutor Evandro Rogério Montanini', '296', 'Parque Clayton Malaman', 'Pirassununga', 'SP', '13635205', '19', '983944598', 'jo_oliveira@bol.com.br'),
(5, NULL, NULL, 9, 'Rua Jaime Dolfini', '721', 'Jardim Rosim', 'Pirassununga', 'SP', '13634110', '19', '36480533', 'tatipsilva@live.com'),
(6, NULL, NULL, 2, 'Avenida Padre Antonio Vann Ess', '1144', 'Centro', 'Pirassununga', 'SP', '13630025', '19', '35613365', 'pirassununga@ipiranga.com.br'),
(7, NULL, NULL, 5, 'R. José Bonifácio', '463', 'Centro', 'Pirassununga', 'SP', '13630010', '19', '35624500', 'upirassununga@drogaraia.com.br'),
(8, NULL, NULL, 7, 'Rua Duque de Caxias', '1412', 'Centro', 'Pirassununga', 'SP', '13630095', '19', '35614487', 'pirassununga@cpernambucanas.com.br'),
(9, NULL, NULL, 10, 'Rua Duque De Caxias', '1525', 'Centro', 'Pirassununga', 'SP', '13630095', '19', '32948282', 'lojapirassununga@seller.com.br'),
(10, NULL, NULL, 8, 'Rua D01', '975', 'Vila dos Oficiais', 'Pirassununga', 'SP', '13643200', '19', '38715467', 'gabrielss@live.com'),
(11, 1, NULL, NULL, 'Rua Benedito da Silva Pinto', '456', 'Vila Braz', 'Pirassununga', 'SP', '13632020', '19', '28556164', NULL),
(12, 2, NULL, NULL, 'Rua Antonia Bianco', '155', 'Jardim Milenium', 'Pirassununga', 'SP', '13643474', '19', '994544780', NULL),
(13, NULL, 1, NULL, 'R. Henry Nestlé', 'SN', 'Vila Formosa', 'São José do Rio Pardo', 'SP', '13720000', '19', '36829100', 'falecom@nestle.com.br'),
(14, NULL, 2, NULL, 'Av Juscelino Kubitschek de Oliveira', '13300', 'Cidade Industrial', 'Curitiba', 'PR', '81460000', '41', '32028000', 'atendimento@kraft.com.br'),
(15, NULL, 3, NULL, 'R. Pais Leme', '524', 'Pinheiros', 'São Paulo', 'SP', '05424150', '11', '38151761', 'corporate.response@genmills.com'),
(16, NULL, 4, NULL, 'R. Comendador José de Matos', '83', 'Jaraguá', 'São Paulo', 'SP', '05177100', '00', '080072755', 'sac@cremer.com.br'),
(17, NULL, 5, NULL, 'Rua Antenor Vivo', '150', 'Distrito Industrial 2', 'Nova Odessa', 'SP', '13460000', '19', '34668800', 'sac@jnjbrasil.com.br'),
(18, NULL, 6, NULL, 'Av. Brg. Faria Lima', '1912', 'Jd. Paulistano', 'São Paulo', 'SP', '01451000', '11', '30935220', 'info@dktinternational.org'),
(19, NULL, 7, NULL, 'Av Manoel Domingos Pinto', '481', 'Parque Anhanguera', 'São Paulo', 'SP', '05120000', '11', '36227655', 'sac@atendimentounilever.com.br');

-- --------------------------------------------------------

--
-- Estrutura para tabela `dependentes`
--

CREATE TABLE `dependentes` (
  `cod_emp` smallint NOT NULL,
  `cod_dep` smallint NOT NULL,
  `nome` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cpf` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parentesco` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_nasc` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `dependentes`
--

INSERT INTO `dependentes` (`cod_emp`, `cod_dep`, `nome`, `cpf`, `parentesco`, `data_nasc`) VALUES
(2, 1, 'Manuela Kamilly Larissa Alves', '49262306822', 'Cônjuge', '1987-12-16'),
(2, 2, 'Joana Corrêa', '09800139842', 'Filha', '2009-03-01');

-- --------------------------------------------------------

--
-- Estrutura para tabela `empregados`
--

CREATE TABLE `empregados` (
  `cod_emp` smallint NOT NULL,
  `nome` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cpf` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rg` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ctps` char(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `conta_fgts` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `conta_salario` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `salario` decimal(6,2) NOT NULL,
  `cod_emp_sup` smallint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `empregados`
--

INSERT INTO `empregados` (`cod_emp`, `nome`, `cpf`, `rg`, `ctps`, `conta_fgts`, `conta_salario`, `salario`, `cod_emp_sup`) VALUES
(1, 'José Lopes', '12345678909', '418757896', '1075807', '2924028436518383', '680211754796', '1500.00', NULL),
(2, 'Rodrigo Corrêa', '48694145898', '2977269', '5663790', '3116006907484520', '008211005130', '1300.00', 1);

-- --------------------------------------------------------

--
-- Estrutura para tabela `entradas`
--

CREATE TABLE `entradas` (
  `cod_ent` int NOT NULL,
  `cod_forn` smallint NOT NULL,
  `cod_emp` smallint NOT NULL,
  `total` decimal(6,2) DEFAULT NULL,
  `data` date NOT NULL,
  `hora` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estrutura para tabela `fornecedores`
--

CREATE TABLE `fornecedores` (
  `cod_forn` smallint NOT NULL,
  `razao_social` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nome_fantasia` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cnpj` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendedor` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `fornecedores`
--

INSERT INTO `fornecedores` (`cod_forn`, `razao_social`, `nome_fantasia`, `cnpj`, `vendedor`) VALUES
(1, 'Nestle Brasil Ltda', 'Nestle', '60409075000152', 'José Luis'),
(2, 'Kraft Foods Brasil S.A.', 'Lacta', '57003881011407', 'Paulo'),
(3, 'Yoki Alimentos S.A.', 'Yoki', '61586558001167', 'Henrique'),
(4, 'Cremer S.A.', 'Cremer', '82641325004377', 'Maria Cecília'),
(5, 'Johnson & Johnson do Brasil', 'Johnson & Johnson', '54516661000101', 'Reginaldo'),
(6, 'DKT do Brasil Produtos de Uso ', 'DKT', '38756680000140', 'Antônio'),
(7, 'Unilever Brasil Ltda', 'Unilever', '53272365000131', 'Fernando'),
(8, 'Josapar S.A.', 'Josapar', '87456562004381', 'Rafaela'),
(9, 'Hersheys\'s do Brasil S.A.', 'Hersheys\'s', '2486707000185', 'Larissa'),
(10, 'Pepsico do Brasil Ltda', 'Pepsico', '31565104028420', 'Gustavo'),
(11, 'Santalucia S.A.', 'Santalucia', '90471798000495', 'Gabriel'),
(12, 'Companhia de Bebidas Ipiranga', 'Coca-cola', '55960736000101', 'Maurício');

-- --------------------------------------------------------

--
-- Estrutura para tabela `itens_entrada`
--

CREATE TABLE `itens_entrada` (
  `cod_ent` int NOT NULL,
  `cod_prod` int NOT NULL,
  `quantidade` smallint NOT NULL,
  `subtotal` decimal(6,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estrutura para tabela `itens_saida`
--

CREATE TABLE `itens_saida` (
  `cod_saida` int NOT NULL,
  `cod_prod` int NOT NULL,
  `quantidade` smallint NOT NULL,
  `desconto_indiv` decimal(3,2) DEFAULT NULL,
  `subtotal` decimal(6,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `itens_saida`
--

INSERT INTO `itens_saida` (`cod_saida`, `cod_prod`, `quantidade`, `desconto_indiv`, `subtotal`) VALUES
(1, 8, 4, '0.00', '0.00'),
(1, 13, 7, '0.00', '0.00'),
(1, 18, 9, '0.00', '0.00'),
(1, 19, 13, '0.00', '0.00'),
(1, 25, 2, '0.00', '0.00'),
(1, 29, 4, '0.00', '0.00'),
(1, 39, 2, '0.00', '0.00'),
(1, 41, 2, '0.00', '0.00'),
(1, 43, 15, '0.00', '0.00'),
(1, 49, 5, '0.00', '0.00'),
(1, 50, 10, '0.00', '0.00'),
(2, 9, 4, '0.00', '0.00'),
(2, 14, 9, '0.00', '0.00'),
(2, 22, 2, '0.00', '0.00'),
(2, 23, 5, '0.00', '0.00'),
(2, 29, 2, '0.00', '0.00'),
(2, 33, 6, '0.00', '0.00'),
(2, 34, 4, '0.00', '0.00'),
(2, 45, 7, '0.00', '0.00'),
(2, 48, 6, '0.00', '0.00'),
(3, 9, 6, '0.00', '0.00'),
(3, 10, 2, '0.00', '0.00'),
(3, 15, 5, '0.00', '0.00'),
(3, 22, 7, '0.00', '0.00'),
(3, 24, 6, '0.00', '0.00'),
(3, 28, 1, '0.00', '0.00'),
(3, 30, 4, '0.00', '0.00'),
(3, 33, 6, '0.00', '0.00'),
(3, 39, 9, '0.00', '0.00'),
(3, 41, 7, '0.00', '0.00'),
(3, 46, 4, '0.00', '0.00'),
(4, 2, 3, '0.00', '0.00'),
(4, 13, 2, '0.00', '0.00'),
(4, 18, 7, '0.00', '0.00'),
(4, 21, 4, '0.00', '0.00'),
(4, 24, 4, '0.00', '0.00'),
(4, 32, 5, '0.00', '0.00'),
(4, 38, 2, '0.00', '0.00'),
(4, 40, 2, '0.00', '0.00'),
(4, 43, 2, '0.00', '0.00'),
(4, 49, 2, '0.00', '0.00'),
(4, 50, 2, '0.00', '0.00'),
(5, 37, 2, '0.00', '0.00'),
(5, 49, 3, '0.00', '0.00'),
(6, 2, 1, '0.00', '0.00'),
(6, 3, 2, '0.00', '0.00'),
(6, 7, 2, '0.00', '0.00'),
(6, 9, 5, '0.00', '0.00'),
(6, 13, 8, '0.00', '0.00'),
(6, 17, 2, '0.00', '0.00'),
(6, 22, 3, '0.00', '0.00'),
(6, 23, 4, '0.00', '0.00'),
(6, 26, 3, '0.00', '0.00'),
(6, 31, 4, '0.00', '0.00'),
(6, 34, 7, '0.00', '0.00'),
(6, 38, 7, '0.00', '0.00'),
(6, 50, 4, '0.00', '0.00'),
(7, 3, 1, '0.00', '0.00'),
(7, 9, 3, '0.00', '0.00'),
(7, 11, 2, '0.00', '0.00'),
(7, 12, 3, '0.00', '0.00'),
(7, 24, 2, '0.00', '0.00'),
(7, 25, 8, '0.00', '0.00'),
(7, 29, 6, '0.00', '0.00'),
(7, 32, 5, '0.00', '0.00'),
(7, 34, 2, '0.00', '0.00'),
(7, 35, 3, '0.00', '0.00'),
(7, 44, 1, '0.00', '0.00'),
(7, 45, 4, '0.00', '0.00'),
(7, 47, 3, '0.00', '0.00'),
(8, 3, 1, '0.00', '0.00'),
(8, 7, 3, '0.00', '0.00'),
(8, 10, 2, '0.00', '0.00'),
(8, 14, 4, '0.00', '0.00'),
(8, 17, 2, '0.00', '0.00'),
(8, 20, 1, '0.00', '0.00'),
(8, 39, 8, '0.00', '0.00'),
(8, 40, 7, '0.00', '0.00'),
(8, 44, 5, '0.00', '0.00'),
(8, 46, 2, '0.00', '0.00'),
(8, 50, 2, '0.00', '0.00'),
(9, 10, 9, '0.00', '0.00'),
(9, 15, 6, '0.00', '0.00'),
(9, 18, 3, '0.00', '0.00'),
(9, 21, 3, '0.00', '0.00'),
(9, 30, 8, '0.00', '0.00'),
(9, 42, 2, '0.00', '0.00'),
(9, 43, 1, '0.00', '0.00'),
(9, 47, 6, '0.00', '0.00'),
(10, 20, 2, '0.00', '0.00'),
(10, 21, 3, '0.00', '0.00'),
(10, 25, 4, '0.00', '0.00'),
(10, 28, 5, '0.00', '0.00'),
(10, 34, 2, '0.00', '0.00'),
(10, 39, 4, '0.00', '0.00'),
(10, 41, 6, '0.00', '0.00'),
(10, 42, 4, '0.00', '0.00'),
(10, 49, 7, '0.00', '0.00'),
(10, 50, 3, '0.00', '0.00'),
(11, 3, 2, '0.00', '0.00'),
(11, 6, 8, '0.00', '0.00'),
(11, 15, 5, '0.00', '0.00'),
(11, 19, 2, '0.00', '0.00'),
(11, 22, 6, '0.00', '0.00'),
(11, 23, 5, '0.00', '0.00'),
(11, 27, 9, '0.00', '0.00'),
(11, 32, 7, '0.00', '0.00'),
(11, 47, 9, '0.00', '0.00'),
(11, 50, 3, '0.00', '0.00'),
(12, 3, 2, '0.00', '0.00'),
(12, 7, 1, '0.00', '0.00'),
(12, 11, 1, '0.00', '0.00'),
(12, 21, 5, '0.00', '0.00'),
(12, 28, 5, '0.00', '0.00'),
(12, 29, 4, '0.00', '0.00'),
(12, 31, 6, '0.00', '0.00'),
(12, 32, 5, '0.00', '0.00'),
(12, 33, 4, '0.00', '0.00'),
(12, 37, 8, '0.00', '0.00'),
(12, 42, 3, '0.00', '0.00'),
(12, 44, 5, '0.00', '0.00'),
(12, 50, 8, '0.00', '0.00'),
(13, 3, 4, '0.00', '0.00'),
(13, 5, 2, '0.00', '0.00'),
(13, 6, 6, '0.00', '0.00'),
(13, 10, 4, '0.00', '0.00'),
(13, 13, 3, '0.00', '0.00'),
(13, 18, 6, '0.00', '0.00'),
(13, 22, 3, '0.00', '0.00'),
(13, 25, 6, '0.00', '0.00'),
(13, 37, 4, '0.00', '0.00'),
(13, 46, 6, '0.00', '0.00'),
(13, 49, 2, '0.00', '0.00'),
(13, 50, 4, '0.00', '0.00'),
(14, 2, 5, '0.00', '0.00'),
(14, 6, 2, '0.00', '0.00'),
(14, 7, 2, '0.00', '0.00'),
(14, 8, 1, '0.00', '0.00'),
(14, 16, 2, '0.00', '0.00'),
(14, 21, 7, '0.00', '0.00'),
(14, 23, 2, '0.00', '0.00'),
(14, 27, 2, '0.00', '0.00'),
(14, 32, 5, '0.00', '0.00'),
(14, 35, 5, '0.00', '0.00'),
(14, 37, 9, '0.00', '0.00'),
(14, 48, 3, '0.00', '0.00'),
(14, 49, 1, '0.00', '0.00'),
(14, 50, 2, '0.00', '0.00'),
(15, 3, 3, '0.00', '0.00'),
(15, 4, 8, '0.00', '0.00'),
(15, 8, 2, '0.00', '0.00'),
(15, 20, 5, '0.00', '0.00'),
(15, 22, 4, '0.00', '0.00'),
(15, 23, 2, '0.00', '0.00'),
(15, 25, 6, '0.00', '0.00'),
(15, 26, 8, '0.00', '0.00'),
(15, 43, 6, '0.00', '0.00'),
(15, 46, 1, '0.00', '0.00'),
(15, 49, 7, '0.00', '0.00'),
(16, 8, 2, '0.00', '0.00'),
(16, 23, 4, '0.00', '0.00'),
(16, 24, 5, '0.00', '0.00'),
(16, 27, 8, '0.00', '0.00'),
(16, 28, 3, '0.00', '0.00'),
(16, 29, 4, '0.00', '0.00'),
(16, 33, 8, '0.00', '0.00'),
(16, 38, 9, '0.00', '0.00'),
(16, 43, 5, '0.00', '0.00'),
(16, 45, 7, '0.00', '0.00'),
(17, 19, 3, '0.00', '0.00'),
(17, 25, 7, '0.00', '0.00'),
(17, 32, 7, '0.00', '0.00'),
(17, 35, 6, '0.00', '0.00'),
(17, 36, 2, '0.00', '0.00'),
(17, 37, 3, '0.00', '0.00'),
(17, 41, 4, '0.00', '0.00'),
(17, 48, 7, '0.00', '0.00'),
(18, 4, 2, '0.00', '0.00'),
(18, 13, 7, '0.00', '0.00'),
(18, 25, 6, '0.00', '0.00'),
(18, 27, 5, '0.00', '0.00'),
(18, 38, 2, '0.00', '0.00'),
(18, 46, 1, '0.00', '0.00'),
(18, 47, 2, '0.00', '0.00'),
(18, 50, 4, '0.00', '0.00'),
(19, 6, 2, '0.00', '0.00'),
(19, 16, 5, '0.00', '0.00'),
(19, 20, 4, '0.00', '0.00'),
(19, 23, 4, '0.00', '0.00'),
(19, 36, 2, '0.00', '0.00'),
(19, 38, 7, '0.00', '0.00'),
(19, 43, 6, '0.00', '0.00'),
(20, 1, 2, '0.00', '0.00'),
(20, 5, 4, '0.00', '0.00'),
(20, 9, 4, '0.00', '0.00'),
(20, 10, 3, '0.00', '0.00'),
(20, 13, 5, '0.00', '0.00'),
(20, 16, 5, '0.00', '0.00'),
(20, 23, 1, '0.00', '0.00'),
(20, 29, 4, '0.00', '0.00'),
(20, 42, 5, '0.00', '0.00'),
(20, 46, 2, '0.00', '0.00');

-- --------------------------------------------------------

--
-- Estrutura para tabela `pessoa_fisica`
--

CREATE TABLE `pessoa_fisica` (
  `cod_cli` smallint NOT NULL,
  `cpf` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rg` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `data_nasc` date DEFAULT NULL,
  `foto` longblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `pessoa_fisica`
--

INSERT INTO `pessoa_fisica` (`cod_cli`, `cpf`, `rg`, `data_nasc`, `foto`) VALUES
(1, '27855162224', '403289440', '1962-12-15', ''),
(4, '31394358601', '911225341', '1995-07-05', ''),
(8, '38016818587', '418757896', '1991-01-19', ''),
(9, '61470874873', '266788658', '1995-06-05', ''),
(3, '67743725979', '2977269', '1989-02-14', ''),
(6, '96775751800', '429434121', '1973-05-18', '');

-- --------------------------------------------------------

--
-- Estrutura para tabela `pessoa_juridica`
--

CREATE TABLE `pessoa_juridica` (
  `cod_cli` smallint NOT NULL,
  `razao_social` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cnpj` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_abertura` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `pessoa_juridica`
--

INSERT INTO `pessoa_juridica` (`cod_cli`, `razao_social`, `cnpj`, `data_abertura`) VALUES
(10, 'Seller Mnt Magazine Ltda', '02647122000108', '1999-05-07'),
(5, 'Droga Raia Ltda - ME', '49388416000118', '1991-06-26'),
(7, 'Arthur Lundgren Tecidos S A Casas Pernambucanas', '61099834032041', '1966-08-02'),
(2, 'Auto Posto Ipiranga Ltda', '83888404000190', '1967-08-28');

-- --------------------------------------------------------

--
-- Estrutura para tabela `produtos`
--

CREATE TABLE `produtos` (
  `cod_prod` int NOT NULL,
  `descricao` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ean` char(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preco_custo` decimal(5,2) NOT NULL,
  `preco_venda` decimal(5,2) NOT NULL,
  `estoque` smallint NOT NULL,
  `imagem` longblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `produtos`
--

INSERT INTO `produtos` (`cod_prod`, `descricao`, `ean`, `preco_custo`, `preco_venda`, `estoque`, `imagem`) VALUES
(1, 'Algodão em Bolas Cremer 50 g', '', '1.00', '2.00', 22, ''),
(2, 'Hastes Flexíveis Johnson & Johnson 150 un', '', '3.00', '4.00', 15, ''),
(3, 'Algodão em Bolas Equate 50 g', '', '2.00', '2.60', 20, ''),
(4, 'Fralda Tripla Proteção Jumbo XG Turma da Mônica 24 un', '', '14.00', '18.00', 35, ''),
(5, 'Curativo Transparente Caixa com 40 unid Band-Aid 1 un', '', '5.00', '7.00', 30, ''),
(6, 'Talco em Pó Tenys Pé Original 100 g', '', '4.00', '6.00', 18, ''),
(7, 'Lenço de Papel para Bolso Softy\'s 1 un', '', '2.00', '3.00', 5, ''),
(8, 'Algodão em Disco Equate 1 un', '', '2.00', '2.60', 40, ''),
(9, 'Lenço de Papel Kids Softy\'s 1 un', '', '1.00', '1.30', 55, ''),
(10, 'Fralda Turma da Mônica Conforto Mega G3 8 un', '', '23.00', '30.00', 50, ''),
(11, 'Preservativo Plus Jontex 3 un', '', '2.00', '2.60', 13, ''),
(12, 'Hastes Flexíveis Turma da Mônica 75 un', '', '1.00', '2.00', 15, ''),
(13, 'Algodão Hidrófilo Equate 25 g', '', '1.00', '1.30', 80, ''),
(14, 'Lenço de Papel Klin 1 un', '', '2.00', '2.60', 13, ''),
(15, 'Escova para Unhas Bettanin 1 un', '', '2.00', '2.60', 10, ''),
(16, 'Preservativo Morango Prudence 3 un', '', '1.00', '1.30', 62, ''),
(17, 'Desodorante para os Pés Rexona 102 g', '', '11.00', '14.00', 18, ''),
(18, 'Preservativo Chocolate Prudence 3 un', '', '1.00', '1.30', 57, ''),
(19, 'Curativos Caixa com 40 unid Band-Aid 1 un', '', '10.00', '13.00', 29, ''),
(20, 'Feijão Preto Caldo Bom 1 Kg', '', '3.00', '5.00', 40, ''),
(21, 'Arroz Tipo 1 Tio João 1 Kg', '', '2.00', '2.60', 38, ''),
(22, 'Feijão Preto Tipo 1 Blue Ville 1 Kg', '', '3.00', '4.00', 44, ''),
(23, 'Arroz Tipo 1 Tio João 5 Kg', '', '9.00', '13.00', 20, ''),
(24, 'Arroz Parboilizado Tipo 1 Tio João 1 Kg', '', '1.00', '2.00', 56, ''),
(25, 'Feijão Carioquinha Caldo Bom 1 Kg', '', '4.00', '6.00', 70, ''),
(26, 'Lentilha Yoki 500 g', '', '2.00', '3.00', 86, ''),
(27, 'Arroz Tipo 1 Blue Ville 1 Kg', '', '1.00', '1.30', 40, ''),
(28, 'Arroz Branco Tipo 1 Prato Fino 1 Kg', '', '1.00', '2.00', 110, ''),
(29, 'Feijão Preto Tipo 1 Biju 1 Kg', '', '3.00', '4.00', 130, ''),
(30, 'Ervilha Partida Yoki 500 g', '', '2.00', '3.00', 45, ''),
(31, 'Arroz Integral Namorado 1 Kg', '', '2.00', '2.60', 19, ''),
(32, 'Canjica Amarela Yoki 500 g', '', '1.00', '1.30', 160, ''),
(33, 'Bombom Especialidades Nestlé 400 g', '', '4.00', '6.00', 86, ''),
(34, 'Chocolate ao Leite Wafer Bis Lacta 126 g', '', '2.00', '3.00', 94, ''),
(35, 'Chocolate KitKat Nestlé 45 g', '', '1.00', '2.00', 129, ''),
(36, 'Chocolate Bis Yogo Lacta 126 g', '', '2.00', '3.00', 138, ''),
(37, 'Chocolate em Barra ao Leite Lacta 170 g', '', '2.00', '4.00', 116, ''),
(38, 'Chocolate em Barra Crunch Nestlé 160 g', '', '2.00', '3.00', 89, ''),
(39, 'Chocolate ao Leite Classic Nestlé 170 g', '', '2.00', '3.00', 99, ''),
(40, 'Bombons Sortidos Garoto 400 g', '', '3.00', '5.00', 38, ''),
(41, 'Chocolate Alpino Nestlé 170 g', '', '2.00', '3.00', 103, ''),
(42, 'Bala Yogurte Dori 150 g', '', '1.00', '2.00', 40, ''),
(43, 'Chocolate Ovomaltine Hershey\'s 130 g', '', '2.00', '3.00', 94, ''),
(44, 'Refrigerante Coca-Cola 2 l', '', '2.00', '3.00', 189, ''),
(45, 'Refrigerante Coca-Cola 2,5 l', '', '2.00', '3.00', 164, ''),
(46, 'Refrigerante Guaraná Antarctica 2 l', '', '2.00', '3.00', 183, ''),
(47, 'Refrigerante Sprite 2 l', '', '2.00', '3.00', 151, ''),
(48, 'Refrigerante Aquarius Fresh Limão 1,5 l', '', '1.00', '2.00', 89, ''),
(49, 'Refrigerante H2OH Limão 1,5 l', '', '2.00', '3.00', 142, ''),
(50, 'Refrigerante Sprite 350 ml', '', '1.00', '1.30', 133, '');

-- --------------------------------------------------------

--
-- Estrutura para tabela `saidas`
--

CREATE TABLE `saidas` (
  `cod_saida` int NOT NULL,
  `cod_cli` smallint NOT NULL,
  `cod_emp` smallint NOT NULL,
  `data` date NOT NULL,
  `hora` time NOT NULL,
  `desconto_geral` decimal(3,2) DEFAULT NULL,
  `total` decimal(6,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Despejando dados para a tabela `saidas`
--

INSERT INTO `saidas` (`cod_saida`, `cod_cli`, `cod_emp`, `data`, `hora`, `desconto_geral`, `total`) VALUES
(1, 5, 1, '0000-00-00', '17:08:22', '0.00', '0.00'),
(2, 6, 1, '0000-00-00', '18:20:40', '0.00', '0.00'),
(3, 7, 1, '0000-00-00', '21:16:46', '0.00', '0.00'),
(4, 8, 2, '0000-00-00', '12:16:51', '0.00', '0.00'),
(5, 10, 2, '0000-00-00', '14:32:11', '0.00', '0.00'),
(6, 10, 1, '0000-00-00', '15:35:01', '0.00', '0.00'),
(7, 1, 2, '0000-00-00', '11:44:07', '0.00', '0.00'),
(8, 2, 1, '0000-00-00', '12:27:11', '0.00', '0.00'),
(9, 3, 2, '0000-00-00', '19:58:17', '0.00', '0.00'),
(10, 4, 1, '0000-00-00', '14:12:24', '0.00', '0.00'),
(11, 5, 2, '0000-00-00', '18:21:29', '0.00', '0.00'),
(12, 6, 2, '0000-00-00', '19:25:37', '0.00', '0.00'),
(13, 7, 2, '0000-00-00', '20:43:41', '0.00', '0.00'),
(14, 8, 2, '0000-00-00', '21:23:44', '0.00', '0.00'),
(15, 3, 1, '0000-00-00', '09:21:49', '0.00', '0.00'),
(16, 2, 1, '0000-00-00', '21:29:52', '0.00', '0.00'),
(17, 1, 1, '0000-00-00', '11:20:56', '0.00', '0.00'),
(18, 4, 1, '0000-00-00', '12:19:04', '0.00', '0.00'),
(19, 2, 2, '0000-00-00', '14:35:12', '0.00', '0.00'),
(20, 9, 1, '0000-00-00', '18:05:18', '0.00', '0.00');

--
-- Índices de tabelas apagadas
--

--
-- Índices de tabela `clientes`
--
ALTER TABLE `clientes`
  ADD PRIMARY KEY (`cod_cli`);

--
-- Índices de tabela `contatos`
--
ALTER TABLE `contatos`
  ADD PRIMARY KEY (`cod_con`),
  ADD KEY `cod_emp` (`cod_emp`),
  ADD KEY `cod_forn` (`cod_forn`),
  ADD KEY `cod_cli` (`cod_cli`);

--
-- Índices de tabela `dependentes`
--
ALTER TABLE `dependentes`
  ADD PRIMARY KEY (`cod_dep`,`cod_emp`),
  ADD UNIQUE KEY `cpf` (`cpf`),
  ADD KEY `cod_emp` (`cod_emp`);

--
-- Índices de tabela `empregados`
--
ALTER TABLE `empregados`
  ADD PRIMARY KEY (`cod_emp`),
  ADD UNIQUE KEY `cpf` (`cpf`),
  ADD KEY `cod_emp_sup` (`cod_emp_sup`);

--
-- Índices de tabela `entradas`
--
ALTER TABLE `entradas`
  ADD PRIMARY KEY (`cod_ent`),
  ADD KEY `cod_emp` (`cod_emp`),
  ADD KEY `cod_forn` (`cod_forn`);

--
-- Índices de tabela `fornecedores`
--
ALTER TABLE `fornecedores`
  ADD PRIMARY KEY (`cod_forn`),
  ADD UNIQUE KEY `cnpj` (`cnpj`);

--
-- Índices de tabela `itens_entrada`
--
ALTER TABLE `itens_entrada`
  ADD PRIMARY KEY (`cod_ent`,`cod_prod`),
  ADD KEY `cod_prod` (`cod_prod`);

--
-- Índices de tabela `itens_saida`
--
ALTER TABLE `itens_saida`
  ADD PRIMARY KEY (`cod_saida`,`cod_prod`),
  ADD KEY `cod_prod` (`cod_prod`);

--
-- Índices de tabela `pessoa_fisica`
--
ALTER TABLE `pessoa_fisica`
  ADD UNIQUE KEY `cpf` (`cpf`),
  ADD KEY `cod_cli` (`cod_cli`);

--
-- Índices de tabela `pessoa_juridica`
--
ALTER TABLE `pessoa_juridica`
  ADD UNIQUE KEY `cnpj` (`cnpj`),
  ADD KEY `cod_cli` (`cod_cli`);

--
-- Índices de tabela `produtos`
--
ALTER TABLE `produtos`
  ADD PRIMARY KEY (`cod_prod`);

--
-- Índices de tabela `saidas`
--
ALTER TABLE `saidas`
  ADD PRIMARY KEY (`cod_saida`),
  ADD KEY `cod_cli` (`cod_cli`),
  ADD KEY `cod_emp` (`cod_emp`);

--
-- AUTO_INCREMENT de tabelas apagadas
--

--
-- AUTO_INCREMENT de tabela `clientes`
--
ALTER TABLE `clientes`
  MODIFY `cod_cli` smallint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT de tabela `contatos`
--
ALTER TABLE `contatos`
  MODIFY `cod_con` smallint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT de tabela `empregados`
--
ALTER TABLE `empregados`
  MODIFY `cod_emp` smallint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de tabela `entradas`
--
ALTER TABLE `entradas`
  MODIFY `cod_ent` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de tabela `fornecedores`
--
ALTER TABLE `fornecedores`
  MODIFY `cod_forn` smallint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT de tabela `produtos`
--
ALTER TABLE `produtos`
  MODIFY `cod_prod` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT de tabela `saidas`
--
ALTER TABLE `saidas`
  MODIFY `cod_saida` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- Restrições para dumps de tabelas
--

--
-- Restrições para tabelas `contatos`
--
ALTER TABLE `contatos`
  ADD CONSTRAINT `contatos_ibfk_1` FOREIGN KEY (`cod_emp`) REFERENCES `empregados` (`cod_emp`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contatos_ibfk_2` FOREIGN KEY (`cod_forn`) REFERENCES `fornecedores` (`cod_forn`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `contatos_ibfk_3` FOREIGN KEY (`cod_cli`) REFERENCES `clientes` (`cod_cli`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Restrições para tabelas `dependentes`
--
ALTER TABLE `dependentes`
  ADD CONSTRAINT `dependentes_ibfk_1` FOREIGN KEY (`cod_emp`) REFERENCES `empregados` (`cod_emp`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Restrições para tabelas `empregados`
--
ALTER TABLE `empregados`
  ADD CONSTRAINT `empregados_ibfk_1` FOREIGN KEY (`cod_emp_sup`) REFERENCES `empregados` (`cod_emp`) ON UPDATE CASCADE;

--
-- Restrições para tabelas `entradas`
--
ALTER TABLE `entradas`
  ADD CONSTRAINT `entradas_ibfk_1` FOREIGN KEY (`cod_emp`) REFERENCES `empregados` (`cod_emp`) ON UPDATE CASCADE,
  ADD CONSTRAINT `entradas_ibfk_2` FOREIGN KEY (`cod_forn`) REFERENCES `fornecedores` (`cod_forn`) ON UPDATE CASCADE;

--
-- Restrições para tabelas `itens_entrada`
--
ALTER TABLE `itens_entrada`
  ADD CONSTRAINT `itens_entrada_ibfk_1` FOREIGN KEY (`cod_ent`) REFERENCES `entradas` (`cod_ent`) ON UPDATE CASCADE,
  ADD CONSTRAINT `itens_entrada_ibfk_2` FOREIGN KEY (`cod_prod`) REFERENCES `produtos` (`cod_prod`) ON UPDATE CASCADE;

--
-- Restrições para tabelas `itens_saida`
--
ALTER TABLE `itens_saida`
  ADD CONSTRAINT `itens_saida_ibfk_1` FOREIGN KEY (`cod_saida`) REFERENCES `saidas` (`cod_saida`) ON UPDATE CASCADE,
  ADD CONSTRAINT `itens_saida_ibfk_2` FOREIGN KEY (`cod_prod`) REFERENCES `produtos` (`cod_prod`) ON UPDATE CASCADE;

--
-- Restrições para tabelas `pessoa_fisica`
--
ALTER TABLE `pessoa_fisica`
  ADD CONSTRAINT `pessoa_fisica_ibfk_1` FOREIGN KEY (`cod_cli`) REFERENCES `clientes` (`cod_cli`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Restrições para tabelas `pessoa_juridica`
--
ALTER TABLE `pessoa_juridica`
  ADD CONSTRAINT `pessoa_juridica_ibfk_1` FOREIGN KEY (`cod_cli`) REFERENCES `clientes` (`cod_cli`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Restrições para tabelas `saidas`
--
ALTER TABLE `saidas`
  ADD CONSTRAINT `saidas_ibfk_1` FOREIGN KEY (`cod_cli`) REFERENCES `clientes` (`cod_cli`) ON UPDATE CASCADE,
  ADD CONSTRAINT `saidas_ibfk_2` FOREIGN KEY (`cod_emp`) REFERENCES `empregados` (`cod_emp`) ON UPDATE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
