46 lines
1.2 KiB
MySQL
46 lines
1.2 KiB
MySQL
|
/* 1. feladat AKA 12.feladat*/
|
||
|
CREATE DATABASE mozaik CHARACTER SET="utf8" COLLATE="utf8_hungarian_ci";
|
||
|
|
||
|
/*14.feladat*/
|
||
|
SELECT COUNT(id) as `nagyrendezvenyek szama`
|
||
|
FROM rendezveny
|
||
|
WHERE letszam >= 100;
|
||
|
|
||
|
/*15. feladat*/
|
||
|
SELECT rendezveny.idopont as `kezdonap`,
|
||
|
rendezveny.napokszama as `napokszama`,
|
||
|
rendezveny.letszam as `resztvevok szama`
|
||
|
FROM rendezveny
|
||
|
INNER JOIN helyszin ON helyszin.id = rendezveny.helyszinId
|
||
|
WHERE helyszin.nev LIKE "Szeged";
|
||
|
|
||
|
|
||
|
/* 16*/
|
||
|
UPDATE kapcsolat SET cegnev = "BugFix IT"
|
||
|
WHERE nev LIKE "Nagy Béla";
|
||
|
|
||
|
/*17*/
|
||
|
SELECT tipus.nev as `tipus`,
|
||
|
rendezveny.letszam / rendezveny.napokszama as `atlagletszam`
|
||
|
FROM rendezveny
|
||
|
INNER JOIN tipus ON tipus.id = rendezveny.tipusId
|
||
|
GROUP BY tipus.nev
|
||
|
ORDER BY `atlagletszam` DESC LIMIT 2;
|
||
|
|
||
|
/*18*/
|
||
|
SELECT helyszin.nev FROM helyszin
|
||
|
WHERE helyszin.nev NOT IN
|
||
|
(SELECT helyszin.nev FROM rendezveny
|
||
|
INNER JOIN helyszin ON helyszin.id = rendezveny.helyszinId);
|
||
|
|
||
|
/*19*/
|
||
|
SELECT kapcsolat.nev as `nev`,
|
||
|
kapcsolat.email as `email cim`,
|
||
|
((rendezveny.napokszama * 20000) + (rendezveny.letszam * 1000))
|
||
|
AS `szervezesi dij`
|
||
|
FROM rendezveny
|
||
|
INNER JOIN tipus ON rendezveny.tipusId = tipus.id
|
||
|
INNER JOIN kapcsolat ON kapcsolat.id = rendezveny.kapcsolatId
|
||
|
WHERE tipus.nev LIKE "tréning";
|
||
|
|