28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
|
-- 13. feladat:
|
||
|
CREATE DATABASE mozi CHARACTER SET="utf8" COLLATE="utf8_hungarian_ci";
|
||
|
|
||
|
|
||
|
-- 15. feladat:
|
||
|
SELECT COUNT(vetites.id) AS `vetitesek_szama` FROM `vetites` WHERE vetites.kezdes = "20:00:00";
|
||
|
|
||
|
|
||
|
-- 16. feladat:
|
||
|
SELECT vendeg.nev AS `vendeg_nev`, COUNT(jegy.id) AS `jegy_db` FROM `jegy` INNER JOIN vendeg ON jegy.vendegId = vendeg.id GROUP BY jegy.vendegId ORDER BY `jegy_db` DESC LIMIT 5;
|
||
|
|
||
|
|
||
|
-- 17. feladat:
|
||
|
UPDATE `film` SET `cim` = "Csillagok között" WHERE film.cim = "Interstellar";
|
||
|
|
||
|
|
||
|
-- 18. feladat:
|
||
|
INSERT INTO `filmtipus`(`nev`) VALUES ("Animációs");
|
||
|
|
||
|
|
||
|
-- 19. feladat:
|
||
|
SELECT vendeg.nev AS `nev`, COUNT(jegy.id) AS `teljes_aru_jegy_db` FROM `jegy` INNER JOIN vendeg ON jegy.vendegId = vendeg.id WHERE jegy.kedvezmeny = 0 GROUP BY jegy.vendegId HAVING vendeg.nev = "Fodor András";
|
||
|
|
||
|
|
||
|
-- 20. feladat:
|
||
|
SELECT film.cim AS `film_neve`, COUNT(jegy.id) AS `jegy_darabszam`, SUM(film.jegyar - film.jegyar * jegy.kedvezmeny / 100) AS `teljes_bevetel` FROM `jegy` INNER JOIN vetites ON jegy.vetitesId = vetites.id INNER JOIN film ON vetites.filmId = film.id GROUP BY film.cim ORDER BY `teljes_bevetel` DESC LIMIT 1;
|
||
|
|