This is an individual assignment. All work must be your own. You should not look at any other student's work (in whole or in part, on paper or on screen), nor allow anyone else to look at yours, during the course of this assignment.
You may turn in hardcopy (typed, submitted during class time on 3/24) or email a plain text, MS Word or PDF document to the instructor with subject line "cs4250,hw2" (by 5pm).
Consider the following relations:
Patient (pid: integer, lname: string, fname: string, primary_did: integer,
Doctor (did: integer, lname: string, fname: string, deptid: integer, age: integer)
Nurse (nid: integer, lname: string, fname: string, deptid: integer, rank: string, age: integer)
Department (deptid: integer, name: string, budget: integer)
TestInfo (testid: integer, name: string, cost: integer, machine_needed: string)
MedTest (testid: integer, pid: integer, dateOrdered: date, whoOrdered: integer, dateGiven: date, timeGiven: time, nid: integer, techID: integer)
The relations capture some basic information about a hospital. Doctors order tests for patients. (MedTest:whoOrdered is a foreign key referencing Doctor:did.) Tests are given by particular nurses and processed by particular lab technicians. Patients have primary care physicians. Doctors work in departments (oncology, pediatrics, etc). Nurses have ranks, like "nurse practitioner", "registered nurse", "licensed practical nurse". (The tasks nurses may legally perform vary by rank.) Some medical tests may require the use of a certain kind of machine -- microscope, MRI machine, audiometer for hearing tests, etc.
The relation of technician information (names, etc) has not been presented here.
(did = doctor ID. lname = last name. pid = patient ID. nid = nurse ID. Etc.)
You may make the simplifying assumption that comparisons on "date" fields will work with basic =, <, >, etc, boolean operators. This is not the case in many DBMS products; for real work you would need to consult the documentation for your particular DBMS software.
Write the following queries in SQL. No duplicates should be printed in any of the answers.
Notes: Dr. Siddhartha Mukherjee is the author of "The Emperor of All Maladies: A Biography of Cancer". Florence Nightingale more or less created the field of modern nursing... and made interesting contributions to statistics and the visualization of scientific data, as well. Dr. Joseph Lister pioneered the use of antisceptics during surgery.