# Miscellaneous > Structured Query Language (SQL) >  Group by & Having in relational algebra

## uydf54

hello every one, I have a question about relational algebra, I can't figure out how to translate the group by and having part of my sql query into relational algebra I have syntax examples but I don't know the correct order of all the parts
here's the query for example:

SELECT table.1
FROM table 
WHERE table.4=5
GROUP BY table.1
HAVING count (table.3)>4

so far I did this part->

Π table.1 (σ table.4=5 (table))

is it possible that that's how u do it?
table.1 g (count (table.3))>4(Π table.1 (σ table.4=5 (table)))

----------

