GROUP BY clause specifies a result table that consists of a grouping of the rows of intermediate result table that…