Escolar Documentos
Profissional Documentos
Cultura Documentos
USE AOBA ;
-- -----------------------------------------------------
-- Table mydb.Ingredients
-- -----------------------------------------------------
);
-- -----------------------------------------------------
-- Table mydb.PRODUTOS
-- -----------------------------------------------------
imagem BLOB,
categoria varchar(30),
);
-- -----------------------------------------------------
-- Table mydb.Ingredients
-- -----------------------------------------------------
);
-- -----------------------------------------------------
-- Table mydb.USUARIO
-- -----------------------------------------------------
senha varchar(30),
);
#### pensamos em atribuir nome para os cargos depois, mas aqui deixar como 1,2,3
-- -----------------------------------------------------
-- Table mydb.COMANDA
-- -----------------------------------------------------
###############
);
-- -----------------------------------------------------
-- Table mydb.ITENS
-- -----------------------------------------------------
REFERENCES Usuario(idUsuario)
);
## Dados inseridos pelo CHAT GPT
VALUES
VALUES
VALUES
VALUES
(1, 1, 'Descrição1'),
(2, 2, 'Descrição2'),
(3, 1, 'Descrição3'),
(4, 4, 'Descrição4'),
(5, 3, 'Descrição5');
VALUES
VALUES
(2, 1, 1, 3, 4),
(1, 2, 0, 5, 2),
(3, 3, 1, 1, 3),
(1, 4, 0, 2, 1),
(4, 5, 1, 4, 5);
##Comandos###################################################################
################################################
from usuario
from produto
##visualizar cardapio
and estado = 1
order by iditem;
from usuario
where ativo = 1
/*--------Função de exemplo---------------
RETURNS INTEGER
BEGIN
SET result = 1;
END IF;
RETURNS result;
END
-----------------------exemplo de procedimento----------------------------
INTEGER)
deterministc
BEGIN
END
*/
delimiter <>
in catprod varchar(50),
in tipoprod varchar(50),
in descprod varchar(50),
in valprod float,
in quantprod integer)
begin
select count(*) into nome_existe from produto where nome = nomeprod and categoria =
catprod;
else
end if;
end<>
##teste
##select*from produto;
in quantprod integer)
begin
if prod_existe = 0 then
else
end if;
end;
<>
##----- teste-----------------
call adicionar_produto(1,40);<>
in quantprod integer)
begin
if prod_existe = 0 then
end if;
end;
<>
#####----- teste-----------------
call remover_produto(1,40);<>