P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause - > yes
Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause - > It doesn't matter
R : All attributes used in the GROUP BY clause must appear in the SELECT clause -> NO
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause -> yes
Introduction to SQL HAVING clause. HAVING condition; The HAVING clause works like the WHEREclause if it is not used with the GROUP BY clause. The difference between the HAVING clause and the WHERE clause is that the WHERE clause is used to filter rows, while the HAVING clause is used to filter groups of rows.
Expressions that are not encapsulated within an aggregate function and must be included in the GROUP BY Clause at the end of the SQL statement. This is an aggregate function such as the SUM, COUNT, MIN, MAX, or AVG functions. This is the column or expression that the aggregate_function will be used on.