0% found this document useful (0 votes)
33 views1 page

Query 4

The document contains SQL queries to preview employee work details and maximum work time per location. It then uses these views to select employee IDs, work time, and reporting locations where the work time matches the maximum allowed for each location. The queries are structured to join the two views based on specific conditions.

Uploaded by

SHUBHAM PANCHAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Query 4

The document contains SQL queries to preview employee work details and maximum work time per location. It then uses these views to select employee IDs, work time, and reporting locations where the work time matches the maximum allowed for each location. The queries are structured to join the two views based on specific conditions.

Uploaded by

SHUBHAM PANCHAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

-- -- let user preview the views generated

SELECT * FROM emp_work_details;


SELECT * FROM max_work_time_per_location;

-- -- use view to find required employee Ids


SELECT v1.EmployeeID, v1.work_time, v1.ReportingLocation FROM
emp_work_details AS v1,
max_work_time_per_location AS v2
WHERE v2.max_work_time=v1.work_time AND
v1.ReportingLocation=v2.ReportingLocation;

You might also like