Código SQL:
Ver original
CREATE OR REPLACE VIEW Vista2 AS SELECT NombreS, critica, tipo FROM Serie WHERE NombreS IN SELECT NombreS FROM Vende HAVING NombreC1='NBC'; CREATE OR REPLACE VIEW Vista3 AS SELECT * FROM Serie WHERE NombreS IN SELECT NombreSR FROM Horario WHERE NombreS='Gossip Girl' AND Hora_emp='9:00pm' AND Hora_fin='10:00pm'; CREATE OR REPLACE VIEW Vista4 AS SELECT * FROM Personaje WHERE CodPer IN SELECT CodPer FROM Interpreta GROUP BY CodPer HAVING COUNT(CodA)> 2; CREATE OR REPLACE VIEW Vista5 AS SELECT m.nombre, a.nombre, a.Nombre_Cantante FROM Musical m, Album a WHERE m.conductor='DJ X' AND m.CodPro=a.CodPro; CREATE OR REPLACE VIEW Vista6 AS SELECT c.Disquera, c.nombre_Can, a.nombre, a.unidades FROM Album a, Cantante c ORDER BY unidades DESC LIMIT 5; CREATE OR REPLACE VIEW Vista8 AS SELECT Director FROM Pelicula GROUP BY Director HAVING SUM(monto)= ALL SELECT MAX(monto) FROM Vista7;
Gracias y saludos!