I want to select the contact info (email and phonenumber) of all employees working between 2 time ranges in shops of type market and have currently more than 2 employees working together
What I want to do: I have an entity EMPLOYEE that is the owner entity of another entity SCHEDULE, and I have a "SHOP" entity with a "shopn" attribute as foreign key of EMPLOYEE
My attempt:
SELECT Email, Phonenumber  
FROM EMPLOYEE  
WHERE COUNT(  
        ID = (SELECT ID_Num  
            FROM SCHEDULE     
            WHERE Start_Time <= 12:07 AND End_Time >= 12:07)  
    AND Shopn = (SELECT Shopname  
            FROM SHOP  
            WHERE Shoptype = ‘market’)
    ) > 2
I am getting ORA-00934 error
Any help would be appreciated.

Start_TimeandEnd_Time? Are they strings? (If so... bad idea!)Start_TimeandEnd_Timein thehh24:miformat (meaning,'04:45'for 4:45 AM and'15:00'for 3 PM? If they are not (for example: if the single-digit hours don't have the leading 0) then your comparisons won't work as intended.