Uploading Work During Assessments You are required to upload…

Uploading Work During Assessments You are required to upload your work for each question. Failure to do so goes against our honor code and is considered academically dishonest.  Please upload your work for all questions directly into this question using the Upload/Record Media option and your external webcam.

A hospital has a patients table with columns city and patien…

A hospital has a patients table with columns city and patient_id. Administrators want to see how many patients are in each city. Which query is correct? SELECT city, COUNT(patient_id) FROM patients GROUP BY city SELECT COUNT(patient_id) FROM patients SELECT city, patient_id FROM patients GROUP BY city SELECT * FROM patients ORDER BY city Answer: SELECT city, COUNT(patient_id) FROM patients GROUP BY city Explanation: COUNT(patient_id) counts patients per city when grouped by city. Without grouping, COUNT only gives the overall total. Grouping with non-aggregated fields like patient_id is invalid, and ORDER BY city just sorts rows without summarizing.

A company needs to create a new table called employees with…

A company needs to create a new table called employees with the following fields: employee_id (unique number) name (text, up to 200 characters) salary (decimal with up to 2 decimal places) Which SQL statement is correct? CREATE TABLE employees (employee_id VARCHAR(200), name INT, salary DECIMAL(10,2)); CREATE TABLE employees (employee_id INT, name VARCHAR(200), salary DECIMAL(10,2)); CREATE TABLE employees (employee_id INT, name DECIMAL(10,2), salary VARCHAR(200)); CREATE employees TABLE (employee_id INT, name VARCHAR(200), salary DECIMAL(10,2)); Answer: CREATE TABLE employees (employee_id INT, name VARCHAR(200), salary DECIMAL(10,2)); Explanation: INT is appropriate for IDs, VARCHAR(200) stores names, and DECIMAL(10,2) supports monetary values with 2 decimal places. The other options either mismatch data types or have invalid syntax.