About the “Operating Room Surgical Procedure Staffing Matrix” SQL Problem
Business Scenario
Hospital operating room directors track scheduled surgical operations by linking cases to the assigned surgical theater room and the lead surgeon.
Expected Output & Criteria
Operating room surgical schedule cross-referencing room and attending surgeon.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMCREATE TABLE operating_suites (
suite_id INT PRIMARY KEY,
suite_name VARCHAR(50) NOT NULL
);
CREATE TABLE surgeons (
surgeon_id INT PRIMARY KEY,
surgeon_name VARCHAR(100) NOT NULL,
specialty VARCHAR(50) NOT NULL
);
CREATE TABLE surgical_cases (
case_id VARCHAR(16) PRIMARY KEY,
suite_id INT REFERENCES operating_suites(suite_id),
surgeon_id INT REFERENCES surgeons(surgeon_id),
scheduled_hours NUMERIC(4, 1) NOT NULL
);Target SQL Clauses & Operators
Want more Joins practice?
Explore the full syllabus of 16 exercises and syntax guides.