summaryrefslogtreecommitdiff
path: root/graphs/sql/where_is_waldo/req06.sql
blob: 8a7a35e9b09baae84bb9f506851be94bf8099a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SELECT
    e.id AS employee_id,
    person_id,
    first_name,
    last_name
FROM nexus_stores.employees AS e
INNER JOIN public.people AS p
    ON e.person_id = p.id
WHERE
    e.id NOT IN (
        SELECT employee_id
        FROM nexus_stores.cashier_shifts
        INNER JOIN nexus_stores.employees
            ON employee_id = employees.id AND position = 'CASHIER'
        WHERE
            start_timestamp = timestamp '2059-12-01 13:00:00'
            AND cashier_shifts.store_id = 78
    )
    AND e.position = 'CASHIER'
    AND e.store_id = 78