Query Consolefour analytical queries · live parameter binding
NOW() = …
→

Query Console

SELECT · JOIN · GROUP BY
editable

            
          
Ctrl+Enter to execute · params bind with ?
idle

Execution plan

hash join
—

Engine notes

LEFT JOIN semantics. A date predicate in WHERE nullifies unmatched rows; moving it into ON preserves employees with zero logged hours. Load the “Naive LEFT JOIN” preset to see rows silently vanish.
Functional dependency. GROUP BY e.employee_id permits e.name because employee_id is the primary key of employees — anything else raises must appear in GROUP BY.
AVG over rows ≠ AVG over heads. AVG(e.hourly_rate) in Q4 averages per timesheet row, weighting frequent reporters. Head-weighted rate is shown beside it.

Log time

INSERT INTO timesheets
rows land as pending

Cost preview

$0.00
estimated labor cost
Employee rate–
Hours–
Week to date (approved)–
Overtime premium–
Project budget left–

Recent entries

0

Approval workflow

manager queue
–

Audit log

0 events

Q1 · Weekly timesheet summary

BETWEEN ? AND ?
SQL

Q2 · Project budget tracking

approved = TRUE
SQL

Q3 · Employee utilization

LEFT JOIN · 30d
SQL

Q4 · Department cost analysis

COUNT DISTINCT · 90d
–90-day cost
SQL

Payroll run

approved rows only
Payroll locks to approved timesheets. Pending rows are excluded and flagged as accrual so the run reconciles after approval.
–

Project cost split (payroll period)

Accrual · pending in period

Tables & indexes

–