Pregunta 1
teoría varia
Pregunta 2
a) alter table categorias drop imagen;
b) alter table categorias modify descripcion varchar(200);
Pregunta 3
a)
INSERT INTO categorias (`NombreCategoria`, `Descripcion`)
VALUE ('chuches', 'regaliz, gominolas y moras');
b)
update categorias
set descripcion='Quesos y leche'
where NombreCategoria='Lácteos';
c)
delete
from categorias
where idCategoria not in
(select idCategoria
from productos);
Pregunta 4
select sum(PrecioUnidad*UnidadesEnExistencia) as ValorStock
from productos;
Pregunta 5
Select IdProveedor
from productos
where IdProducto =
(select count(IdProducto)
from productos
group by IdProveedor
order by 1 desc
limit 1);
from productos
where IdProducto =
(select count(IdProducto)
from productos
group by IdProveedor
order by 1 desc
limit 1);
Pregunta 6
create view pregunta6 (NombreCompania, TotalPedidos) as
select NombreCompania, ifnull(count(idpedido),0)
from clientes cl left join pedidos pe
on cl.idCliente=pe.idCliente
group by 1
order by 2 desc;
0 comentarios:
Publicar un comentario