The GROUP BY SQL is used to partition a table into multiple distinct groups based on column values. Learn how to use the GROUP BY clause to groups records into summary rows.
- [Instructor] The group by sequel syntax…which is often combined with…certain aggregate functions such as…COUNT…MAX…SUM…MEAN…or AVERAGE…is used to group the result set…from our query…based on one or more columns.…Let's see a very simple example…of using group by in a select statement.…In our example,…we simply want to count…how many employees…have been assigned to each one of our departments.…
So in order to accomplish that…we'll type select count…and then inside parenthesis we'll just type…the star character comma…and department id…from our employees table…group by, this is where the new syntax comes into play,…department id.…Essentially telling oracle to count…the number of rows…in our table…in groups.…And we perform the group by…using the department id column.…
So that you can see that we have six employees…assigned to department id 100…and another six employees…assigned to department id 30.…Note they can also add an alias…to the count syntax in my sequel query…to make it more readable.…So for example,…as NUM…underscore Employees.…
Note: This training course is appropriate for beginning database developers with no prior experience with SQL or Oracle.
- Using Oracle SQL*Developer, the free development environment
- Selecting data from tables
- Filtering data
- Using functions to manipulate data
- Joining data from tables
- Creating tables
- Updating values
- Truncating data
- Grouping and ordering result sets
- Working with primary keys
- Checking constraints
Skill Level Beginner
Oracle 12c Database: Administrationwith David Yahalom3h 58m Beginner
Database Foundations: Core Conceptswith Adam Wilbert2h 14m Beginner
Database Foundations: Administrationwith Adam Wilbert1h 14m Beginner
Learning Relational Databases (2014)with Adam Wilbert2h 39m Beginner
1. Introduction to SQL
2. Preparing the Course Environment
Downloading the course VM2m 16s
3. Using Oracle SQL Developer
4. Basic SELECT Queries
5. String, Number, and Date Functions
6. Joining Table Data
7. Manipulating Data
8. Grouping Data
9. Advanced Topics
Next steps1m 33s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.