The SQL Group By statement is used to organize similar data into groups. The data is further organized using an…