-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8_USER_VIEWS.sql
More file actions
46 lines (26 loc) · 894 Bytes
/
8_USER_VIEWS.sql
File metadata and controls
46 lines (26 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--LOGIN AS USER PL_USER1
--EXECUTION ORDER: 8
set SERVEROUTPUT on
CLEAR SCREEN;
--To display the vehicles belonging to the customer
SELECT * FROM PLADMIN.CUSTOMER_VEHICLES;
--To display the booking details of the customer
select * from PLADMIN.BOOKING_DETAILS
where customer_id=1;
--TO display the booking_history of the customer
select * from PLADMIN.BOOKING_HISTORY
where customer_id=1;
--To display the rating of all parking lots
select * from PLADMIN.PARKING_LOT_RATING;
-- To display the available slots on a particular day - time specified.
SELECT *
FROM PLADMIN.AVAILABLE_SLOTS
WHERE PARKING_SLOT_ID NOT IN (
SELECT DISTINCT pb.PARKING_SLOT_ID
FROM PLADMIN.SLOT_BOOKING pb
WHERE
NOT (
(TIMESTAMP '2021-03-21 18:00:00' <= pb.SCHEDULED_START_TIME) OR
(TIMESTAMP '2021-03-21 20:00:00' >= pb.SCHEDULED_END_TIME)
)
);