From the course: From Excel to SQL

Unlock the full course today

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

Grouping data

Grouping data

From the course: From Excel to SQL

Start my 1-month free trial

Grouping data

- Now we know that the power of data doesn't really come from rows and rows of results. The power of data comes from the insight we can extract from it. And organizing your data is one of the key steps you can take to better understanding it. So let's take a look at a simple way you might organize your data. Let's imagine that you're responsible for employee head count within your company. So you want to find out how many employees each department currently has. The output we want to see is the department name, followed by the number of employees in that department. To organize results in this way, we need to take advantage of the GROUP BY clause. Let's open up DB Browser and take a look at how to use the GROUP BY. So the first thing we do is specify the information we want to return from the database. So let's select department, which represents the department name. And then we want to count each employee within…

Contents