USE luna2_innodb;

#a
SELECT * FROM tblabteilung;

#b
SELECT M_Vorname, M_Name FROM tblmitarbeiter;

#c
SELECT A_Name, A_Nr FROM tblabteilung WHERE A_Stadt = "München";

#d
SELECT M_Vorname, M_Name FROM tblmitarbeiter WHERE M_Nr >= 15000;

#e
SELECT * FROM tblprojekt WHERE P_Mittel > round(60000*0.9095, 2);

#f
SELECT M_Nr, P_Nr, T_Taetigkeit FROM tbltaetigkeit WHERE P_Nr = "p2";

#g, h
SELECT distinct(M_Nr) FROM tbltaetigkeit WHERE P_Nr IN ("p1", "p2");

#i
SELECT M_Nr, M_Name FROM tblmitarbeiter WHERE NOT A_Nr = "a2";

#j
SELECT * FROM tblmitarbeiter WHERE M_Nr IN (29346, 28559, 25384);

#k
SELECT * FROM tblmitarbeiter WHERE M_Nr NOT IN (10102, 9031);

#l
SELECT P_Name, P_Mittel FROM tblprojekt WHERE P_Mittel BETWEEN 95000 AND 120000;

#m
SELECT M_Nr FROM tbltaetigkeit WHERE T_Taetigkeit = "Projektleiter" AND NOT YEAR(T_Einstellungsdatum) = 1988;
                                                                      #T_Einstellungsdatum NOT BETWEEN "1988-01-01" AND "1988-12-31";

#n
SELECT M_Nr, P_Nr FROM tbltaetigkeit WHERE T_Taetigkeit IS NULL AND P_Nr = "p1";

#o
SELECT M_Vorname, M_Name, M_Nr FROM tblmitarbeiter WHERE M_Name LIKE "K%";

#p
SELECT M_Name, M_Vorname, M_Nr FROM tblmitarbeiter WHERE M_Vorname LIKE "_a%";

#q
SELECT A_Nr, A_Stadt FROM tblabteilung WHERE A_Name BETWEEN "E%" AND "O%";

#r
SELECT M_Name, M_Vorname, M_Nr FROM tblmitarbeiter;
SELECT M_Name, M_Vorname, M_Nr FROM tblmitarbeiter WHERE NOT (M_Name BETWEEN "M%" AND "Q%" OR M_Vorname LIKE "H%");

#s
SELECT * FROM tblmitarbeiter WHERE NOT M_Name LIKE "%mann";