From the course: Querying Microsoft SQL Server 2019
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Group rows and aggregate data - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2019
Solution: Group rows and aggregate data
(offbeat uplifting music) - [Instructor] In this challenge, we're given a table of exam scores and we need to obtain some summary calculations. The table that we have is called Student Scores, so we'll just start by running that select star from it. We can see all the data that it contains. This table contains a student ID and student name and class column, so we can see each of our individual students and the classes that they're enrolled in, as well as their midterm and final exam scores listed out there. So now we need to summarize this information by class so we can see what the average midterm and the average final is for each class, and then compare those together. So we can start by selecting just the class column out of the data table. Now when I do that though, it's still going to return each individual row for all of my students. So I can see physics as repeated over and over again, calculus below that, and history there. In order to get these to show me just a single row…