Question: GROUPING #5-2 The following SQL query retums one row per surgeon. The granularity before GROUP BY is a surgeon panel combination, in other words, for

 GROUPING #5-2 The following SQL query retums one row per surgeon.

GROUPING #5-2 The following SQL query retums one row per surgeon. The granularity before GROUP BY is a surgeon panel combination, in other words, for coch surgeon, one panel they performed in. Surgeons aan only be listed once per panel, but a log con hove more than one panel. SELECT staff. STAFF_NM_WID"Surgeon", COUNT( OP.LOG_10 ) Number of Logs" FROM OR_LOG or1 INNER JOIN V_LOG_STAFF staff ON or.LOG_ID = staff.LOG_ID INNER JOIN OR_LOG_ALL_PROC procs ON orl.LOG_ID - procs.LOG_10 AND procs. LINE = 1 --First listed procedure WHERE staff.STAFF_TYPE_MAP_NM - 'Physician GROUP BY stoff. STAFF NM WID Ponels are identified by the column procs ALL PROCS_PANEL. Logs are identified by the column orl.LOG_10. Part 2 of 2 Which of the following steps are necessary to count the number of logs a surgeon performed in, while avoiding counting logs twice when a surgeon performed in more than one panel? SELECT ONE OF THE FOLLOWING (1 PT) A. Change - SELECT to "SELECT DISTINCT" B. Change COUNT( ortLOG_ID ) to "DISTINCT COUNT( od.LOG_ID)" C. Change COUNT( Orl.LOG_ID ) to COUNT( DISTINCT OR.LOG_ID)" D. None of the above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!