Question: Consider the provided SQL query. What does it do? SELECT auditorRep.location_id, visitsTbl.record_id, auditorRep.true_water_source_score AS auditor_score, wq.subjective_quality_score AS employee_score, wq.subjective_quality_score - auditorRep.true_water_source_score AS score_diff FROM auditor_report
Consider the provided SQL query. What does it do? SELECT auditorRep.location_id, visitsTbl.record_id, auditorRep.true_water_source_score AS auditor_score, wq.subjective_quality_score AS employee_score, wq.subjective_quality_score - auditorRep.true_water_source_score AS score_diff FROM auditor_report AS auditorRep JOIN visits AS visitsTbl ON auditorRep.location_id = visitsTbl.location_id JOIN water_quality AS wq ON visitsTbl.record_id = wq.record_id WHERE (wq.subjective_quality_score - auditorRep.true_water_source_score) > 9; The query retrieves the location_id, record_id, and water scores by JOINING the water_quality and visits table, and then calculates a difference in scores between the employee's scores and the auditor's scores. The query retrieves the auditor records where the auditor found all of the records with incorrect scores. The query retrieves the auditor records where employees assigned very high scores to very poor water sources. The query retrieves the location_id, record_id, and water scores, and calculates a difference in scores between the employee's scores and the auditor's scores
Step by Step Solution
There are 3 Steps involved in it
Lets break down the provided SQL query to understand what it does stepbystep SQL Query SELECT auditorReplocationid visitsTblrecordid auditorReptruewat... View full answer
Get step-by-step solutions from verified subject matter experts
