Complex filtering

I have a data table that needs complex filtering. It is that kind of interrogation that needs "GROUP BY any-of-the-column" "WHERE any-of-the-column = value" "SORT BY any-of-the-column".

I know good data tables allow users to scan, analyze and manipulate information in a complex way, but I'm afraid that the users will be confused with all the filters because it is a little confusing for me too.

I have some solutions, but I feel none is enough good, so I'd love to hear some thoughts on how to add all that conditions without overwhelming the user.

Thank you a lot for the time to read this!