Question: -- 2.0) Retrieve two tuples from patients. -- SELECT * FROM hw3.patients LIMIT 2; -- 2.1) What are the 'unique values' for patient 'race'? Sort

-- 2.0) Retrieve two tuples from patients. -- SELECT * FROM hw3.patients LIMIT 2; -- 2.1) What are the 'unique values' for patient 'race'? Sort them ascending. -- Hint: there will be 15 results (5 points). - 2.2) Provide the 'number of patients' (i.e., count) 'by race' with a birth year between 1920 and 1950. Only display those races with more than 20 patients. Order the results by the 'number of patients' descending. Solve in parts (7 points). -- 2.2.1) Return the 'count by race' for those patients with a birth year between 1920 and 1950. -- Hint: "OTHER" = 155 (4 points). -- 2.2.2) To 2.2.1, limit the results to those races with more than 20 patients, then sort by -- 'number of patients'. Hint: "OTHER" = 155 (3 points). -- 2.3) List all 'distinct medications' patient 48451 (patient_id) has ever taken in sorted order. Use 'only two relations' to complete this transaction. Solve in parts (5 points). -- 2.3.1) Write the join for the necessary relations and list all 'distinct medications'. Hint: there will be 1,895 results (3 points). -- 2.3.2) Constrain the results of 2.3.1 by patient 48451 and sort. Hint: there will be 4 results (2 points). -- 2.4) Retrieve the patient id(s) and weight 'in pounds' for the patient(s) with the highest recorded weight - see data dictionary for details. Solve in parts (10 points). -- 2.4.1) First determine the highest recorded weight 'in ounces'. Hint: the value will be greater than 10,000 (4 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
