Question: Write a SQL query that will utilize the two datasets in this spreadsheet and result in a single table as described below: A list of


Write a SQL query that will utilize the two datasets in this spreadsheet and result in a single table as described below:

A list of doctors, sorted by Doctor ID (from largest to smallest) with at least one call in the following date range - 1/1/2020 - 12/31/2020.

Columns in the final table should be: Doctor ID, Doctor First Name, Doctor Last Name, Number of Blue Calls, Number of Green Calls, Total Calls

Number of Blue Calls is defined as the Number of Calls in the aforementioned date range where Blue is the Call Type

Number of Green Calls is defined as the Number of Calls in the aforementioned date range where Green is the Call Type

Number of Total Calls is defined as the Number of Calls in the aforementioned date range, regardless of Call Type.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To achieve this in SQL assuming you have two tables doctors and calls and calls table ha... View full answer

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!