From the course: Advanced SQL: Logical Query Processing, Part 2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution

Solution - SQL Tutorial

From the course: Advanced SQL: Logical Query Processing, Part 2

Start my 1-month free trial

Solution

- [Instructor] Like always, I'll start with the from clause. Obviously I need the vaccinations table and since I need the staff member's first and last name, let's call them vaccinators. I'm going to need to join vaccinations to persons based on email. Let's execute just for good measures and move on. I need to group by multiple dimensions, so guess which feature I'm going to use. From here, it's just a matter of following the required grouping sets as they are spelled out. Empty parentheses will give us the grand total. To get the annual total, I'll add year of vaccination time. To get species, well you guessed it. For the combination of year and species, I need both expressions in parentheses. Next are the vaccinators. Here I hope you did not fall for the trap that I set for you and used first name and last name to identify vaccinators. With this data set, it's pretty obvious that the email addresses consist…

Contents