Write a SQL query that will utilize the two datasets in this spreadsheet and result in a
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 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.
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi