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

SELECT *
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID; 

SELECT Onoma, IDTainias
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID
GROUP BY Onoma, IDTainias;


SELECT Onoma, COUNT(DISTINCT TS.IDTainias)
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID
GROUP BY Onoma
HAVING COUNT(*) > 1 


SELECT Onoma, IDTainias, COUNT(*)
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID
GROUP BY Onoma, IDTainias
HAVING COUNT(*) > 1

SELECT Onoma, IDTainias, COUNT(DISTINCT TS.IDTainias)
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID
GROUP BY Onoma, IDTainias
HAVING COUNT(DISTINCT TS.IDTainias) > 1 


SELECT Onoma, COUNT(DISTINCT TS.IDTainias)
FROM TS INNER JOIN SYNTELESTHS ON TS.IDSyntelesth= SYNTELESTHS.ID
GROUP BY Onoma
HAVING COUNT(DISTINCT TS.IDTainias) > 1 

