set echo on;

alter session set nls_language = english;
alter session set nls_date_format = 'DD-MON-YYYY';
alter session set nls_date_language = english;


/* COUNT GROUP BY */
SELECT FLC, COUNT(*) 
FROM PASSAGIER, BUCHUNG
WHERE (PASSAGIER.PNR = BUCHUNG.PNR)
AND (BUCHUNG.VON = 'FRA')
GROUP BY FLC;

/* COUNT GROUP BY */
SELECT FLC, COUNT(*) 
FROM PASSAGIER, BUCHUNG
WHERE (PASSAGIER.PNR = BUCHUNG.PNR)
AND (BUCHUNG.VON = 'FRA')
AND (BUCHUNG.NACH = 'CDG')
GROUP BY FLC;

/* COUNT GROUP BY */
SELECT FLC, COUNT(*) 
FROM PASSAGIER, BUCHUNG
WHERE (PASSAGIER.PNR = BUCHUNG.PNR)
AND (BUCHUNG.BNR >= 500)
AND (BUCHUNG.BNR <= 1500)
GROUP BY FLC;

/* COUNT GROUP BY */
SELECT FLC, COUNT(*) 
FROM PASSAGIER, BUCHUNG
WHERE (PASSAGIER.PNR = BUCHUNG.PNR)
AND (PASSAGIER.GEBDATINT > 14000)
GROUP BY FLC;

rollback;

