--Lab 3, Παράδειγμα σελ 28 

SELECT Typos, AVG(Posotita) AS 'AVG(Posotita)', AVG(Timh) AS 'AVG(Timh)'
FROM KASETA
WHERE Timh <= 2
GROUP BY ALL Typos;

SELECT Typos, AVG(Posotita) AS 'AVG(Posotita)', AVG(Timh) AS 'AVG(Timh)'
FROM KASETA
WHERE Timh > 2
GROUP BY ALL Typos;


SELECT Typos, Posotita, AVG(Posotita) AS 'AVG(Posotita)', AVG(Timh) AS 'AVG(Timh)'
FROM KASETA
WHERE Timh <= 2
GROUP BY ALL Typos, Posotita;

SELECT Typos, Posotita, AVG(Posotita) AS 'AVG(Posotita)', AVG(Timh) AS 'AVG(Timh)'
FROM KASETA
WHERE Timh > 2
GROUP BY ALL Typos, Posotita;


SELECT Typos, MAX(Timh) AS 'MAX(Timh)'
FROM KASETA
WHERE Timh <= 2
GROUP BY ALL Typos
HAVING MIN(Posotita) > 1

SELECT Typos, MAX(Timh) AS 'MAX(Timh)'
FROM KASETA
WHERE Timh > 2
GROUP BY ALL Typos
HAVING MIN(Posotita) > 1



