2023-10-03 05:57:37 +00:00
|
|
|
A feladatok megoldására elkészített SQL parancsokat illessze be a feladat sorszáma után!
|
|
|
|
***
|
|
|
|
14. feladat
|
|
|
|
|
|
|
|
***
|
|
|
|
16. feladat
|
|
|
|
|
|
|
|
SELECT count(etel) AS `etelek-szama`
|
|
|
|
FROM termekek
|
|
|
|
WHERE termekek.etel = 1;
|
|
|
|
|
|
|
|
***
|
|
|
|
17. feladat
|
|
|
|
|
|
|
|
SELECT termekek.nev AS "nev", termekek.ar AS "egysegar"
|
|
|
|
FROM termekek, kategoriak
|
|
|
|
WHERE kategoriak.nev = "Desszertek"
|
|
|
|
ORDER BY termekek.nev DESC;
|
|
|
|
|
|
|
|
***
|
|
|
|
18. feladat
|
|
|
|
|
|
|
|
INSERT INTO termekek
|
|
|
|
(nev, ar, etel, kategoriaId)
|
|
|
|
VALUES
|
|
|
|
('Málnahabos pohárkrém', 1090, 1, 6);
|
|
|
|
|
|
|
|
***
|
|
|
|
19. feladat
|
|
|
|
|
|
|
|
SELECT sum(rendelesek.mennyiseg) AS `mennyiseg` FROM rendelesek
|
|
|
|
WHERE MONTH(rendelesek.datum) = 2
|
|
|
|
GROUP BY rendelesek.termekId
|
|
|
|
ORDER BY `mennyiseg` DESC
|
|
|
|
LIMIT 3;
|
|
|
|
|
|
|
|
***
|
|
|
|
20. feladat
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
round(sum(rendelesek.termekAr)) AS `brutto`,
|
2023-10-10 06:49:56 +00:00
|
|
|
round(sum(rendelesek.termekAr * (1 - (1 / (1 + rendelesek.afakulcs))))) AS `afa`
|
|
|
|
FROM rendelesek;
|