A financial services firm keeps client information in a tabl…
A financial services firm keeps client information in a table called clients. If an analyst only needs to see the first name and last name of each client, which SQL statement should they use? SELECT * FROM clients SELECT firstname, lastname FROM clients SELECT firstname AND lastname FROM clients SELECT name FROM clients Answer: SELECT firstname, lastname FROM clients Explanation: Listing column names separated by commas allows retrieval of only those specific fields. Using * would pull all fields, AND is not valid in a SELECT list, and name would be incorrect unless the table had a single name column.
Read DetailsUploading 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.
Read DetailsA hospital has a patients table with sensitive data. To allo…
A hospital has a patients table with sensitive data. To allow an assistant to see only names and cities of patients in Madison, which SQL should be used? CREATE VIEW madison_patients AS SELECT name, city FROM patients WHERE city = ‘Madison’; CREATE VIEW madison_patients AS SELECT * FROM patients; CREATE TABLE madison_patients AS SELECT name, city FROM patients WHERE city = ‘Madison’; SELECT name, city FROM patients WHERE city = ‘Madison’; Answer: CREATE VIEW madison_patients AS SELECT name, city FROM patients WHERE city = ‘Madison’; Explanation: CREATE VIEW defines a virtual table limited to specific columns and rows. CREATE TABLE makes a physical copy instead of a view. A plain SELECT just queries but doesn’t save a view.
Read Details