2023-05-25 14:57:43 +02:00
|
|
|
|
2023-05-25 16:04:39 +02:00
|
|
|
--Funktionstest mostValuableClerk:
|
2023-05-25 14:57:43 +02:00
|
|
|
|
|
|
|
BEGIN
|
2023-05-25 16:04:39 +02:00
|
|
|
--Test für die letzten 5 Monate:
|
2023-05-25 14:57:43 +02:00
|
|
|
DBMS_OUTPUT.PUT_LINE('Wertvollster Mitarbeiter:');
|
|
|
|
DBMS_OUTPUT.PUT_LINE(mostValuableClerk(5));
|
2023-05-25 16:04:39 +02:00
|
|
|
--Output: 2
|
|
|
|
END;
|
|
|
|
BEGIN
|
|
|
|
--Test für die letzten 12 Monate:
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Wertvollster Mitarbeiter:');
|
|
|
|
DBMS_OUTPUT.PUT_LINE(mostValuableClerk(12));
|
|
|
|
--Output: 3
|
|
|
|
END;
|
2023-05-31 15:36:46 +02:00
|
|
|
BEGIN
|
|
|
|
--Test für die letzten 0 Monate (Fehler da keine Daten vorhanden/ 0 Monate nicht semantisch sinnvoll:
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Wertvollster Mitarbeiter:');
|
|
|
|
DBMS_OUTPUT.PUT_LINE(mostValuableClerk(0));
|
|
|
|
--Output: ---
|
|
|
|
END;
|
2023-05-25 16:04:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--Prozedurtest getLastBookings:
|
2023-06-03 11:59:38 +02:00
|
|
|
DECLARE
|
|
|
|
ids bookingIds;
|
2023-05-25 16:04:39 +02:00
|
|
|
BEGIN
|
|
|
|
--Test für die letzten 7 Monate:
|
2023-05-25 14:57:43 +02:00
|
|
|
DBMS_OUTPUT.PUT_LINE('Letzten Buchungen:');
|
2023-06-03 11:59:38 +02:00
|
|
|
ids := getLastBookings(5);
|
|
|
|
FOR id IN ids.FIRST..ids.LAST
|
|
|
|
LOOP
|
|
|
|
DBMS_OUTPUT.PUT_LINE(id);
|
2023-06-03 12:00:38 +02:00
|
|
|
END LOOP;
|
2023-05-25 16:04:39 +02:00
|
|
|
--Output: 1-10
|
2023-05-30 08:46:57 +02:00
|
|
|
END;
|
2023-06-03 11:59:38 +02:00
|
|
|
DECLARE
|
|
|
|
ids bookingIds;
|
2023-05-25 16:04:39 +02:00
|
|
|
BEGIN
|
|
|
|
--Test für die letzten 9 Monate:
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Letzten Buchungen:');
|
2023-06-03 11:59:38 +02:00
|
|
|
ids := getLastBookings(9);
|
|
|
|
FOR id IN ids.FIRST..ids.LAST
|
|
|
|
LOOP
|
|
|
|
DBMS_OUTPUT.PUT_LINE(id);
|
2023-06-03 12:00:38 +02:00
|
|
|
END LOOP;
|
2023-05-25 16:04:39 +02:00
|
|
|
--Output: 1-14
|
2023-05-30 08:46:57 +02:00
|
|
|
END;
|
2023-05-25 14:57:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-25 16:04:39 +02:00
|
|
|
--Prozedurtest rooms:
|
2023-05-25 14:57:43 +02:00
|
|
|
|
2023-05-25 16:04:39 +02:00
|
|
|
BEGIN
|
|
|
|
--Test für Client 10 und letzten 5 Monate:
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Gebuchte Zimmer:');
|
|
|
|
rooms(10, 5);
|
|
|
|
--Output: 8+9+10
|
2023-05-30 08:46:57 +02:00
|
|
|
END;
|
2023-05-25 16:04:39 +02:00
|
|
|
BEGIN
|
|
|
|
--Test für Client 3 und letzten 8 Monate:
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Gebuchte Zimmer:');
|
|
|
|
rooms(8, 8);
|
|
|
|
--Output: 5
|
2023-05-30 08:46:57 +02:00
|
|
|
END;
|
2023-05-31 13:40:40 +02:00
|
|
|
BEGIN
|
|
|
|
-- Fehler: Neuer Client hat keine Buchungen
|
|
|
|
INSERT INTO Person VALUES (555, 'Max', 'Müller', 28, 1);
|
|
|
|
INSERT INTO CLIENT VALUES (555, 17980641);
|
|
|
|
|
|
|
|
DBMS_OUTPUT.PUT_LINE('Gebuchte Zimmer:');
|
|
|
|
rooms(555, 8);
|
|
|
|
-- Output: none
|
|
|
|
END;
|