You are on page 1of 2

a)SELECT "Nombre_Pelicula" FROM "Pelicula","Funcion" Where

"Pelicula"."id_Pelicula"="Funcion"."id_Pelicula" and "Actor"='Denzel Washington' and


"Fecha_Inicio" BETWEEN '2019-01-01' AND '2019-08-01'

c)SELECT distinct "Nombre_Pelicula" from "Pelicula", "Funcion" where "Actor"= 'Tom Cruise' or
"Actor"= 'Chris Hemsworth' or "Actor"='Robert Downey Jr.' and ("Estreno_Mundial" BETWEEN '2019-01-
01' and '2019-12-31') and ("Fecha_Inicio" BETWEEN '2019-01-01' AND '2019-06-30') and
"Funcion"."id_Pelicula"="Pelicula"."id_Pelicula" and "Genero"='Accion'

b)
select * from(

select "Nombre_Pelicula", cantper, rank() over (order by cantper desc) as ranking

from(

Select "Nombre_Pelicula", SUM (CantPersonas) as CantPer

From (Select "Nombre_Pelicula",


("Funcion"."Num_AsientosTotal"-"Funcion"."Num_AsientosLibres") as CantPersonas

From "Pelicula","Funcion"

where "Funcion"."id_Pelicula"="Pelicula"."id_Pelicula" and ("Fecha_Inicio" BETWEEN


'2019-01-01' and '2019-03-31') ) as subCon

Group By "Nombre_Pelicula") as sub) as consul

where ranking<=10
Select "Nombre_Empleado","Apellido_Empleado","Direccion","Telefono",SUM("DiasTrabajados") as
DiasTrab From(

select "Nombre_Empleado","Apellido_Empleado","Direccion","Telefono",
AGE(a."Fecha_Fin",a."Fecha_Incio") as "DiasTrabajados"

from "Empleado" as e, "Turno" as t, "Asignacion" as a

Where (t."Tipo_Cargo"='Candy' or t."Tipo_Cargo"='Boleteria') and (a."Fecha_Incio" between


'2019-10-01'and '2019-10-31') and (a."Fecha_Fin" between '2019-10-01'and '2019-10-31') and
"id_Sucursal"='5602' and a."id_Empleado"= e."id_Empleado" and
t."Nombre_Turno"=a."Nombre_Turno" and t."Tipo_Cargo"=a."Tipo_Cargo"

Group By e."id_Empleado", a."Fecha_Fin",a."Fecha_Incio") as subc

Group by "Nombre_Empleado","Apellido_Empleado","Direccion","Telefono"

order by Sum("DiasTrabajados")desc

E)
SELECT "Nombre_Combo"
FROM "Combo","Detalle_ventaCombo","Venta_Combo","Caja","Sucursal"
Where "Combo"."id_Combo"="Detalle_ventaCombo"."id_Combo" and
"Detalle_ventaCombo"."id_DetalleVentaC"="Venta_Combo"."id_VentaDetalleC" and
"Caja"."id_Caja"="Venta_Combo"."id_Caja" and "Caja"."id_Sucursal"=5602

You might also like