V4.1
This commit is contained in:
parent
14713af98b
commit
766d928613
2 changed files with 25 additions and 1 deletions
23
SQL/PLSQL.sql
Normal file
23
SQL/PLSQL.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
|
||||
CREATE OR REPLACE FUNCTION mostValuableClerk(months IN NUMBER) RETURN NUMBER
|
||||
IS
|
||||
startMonat DATE;
|
||||
BEGIN
|
||||
startMonat := ADD_MONTHS(SYSDATE,-months);
|
||||
|
||||
SELECT MAX(Anzahl) FROM
|
||||
(
|
||||
SELECT DISTINCT CLERKID, COUNT(CLERKID) AS Anzahl
|
||||
From
|
||||
(
|
||||
SELECT clcl.CLERKID
|
||||
FROM CLEANINGCLERK clcl
|
||||
INNER JOIN CLEANINGPLAN clpl ON clcl.CLEANINGPLANID = clpl.CLEANINGPLANID
|
||||
WHERE clpl."date" >= startMonat
|
||||
)
|
||||
GROUP BY CLERKID
|
||||
);
|
||||
|
||||
return null;
|
||||
END;
|
|
@ -97,4 +97,5 @@ CREATE TABLE BookingRoom (
|
|||
PRIMARY KEY(bookingId, roomNumber),
|
||||
FOREIGN KEY (bookingId) REFERENCES Booking(bookindId),
|
||||
FOREIGN KEY (roomNumber) REFERENCES Room(roomNumber)
|
||||
);
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue