New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

PostgreSQL PGCES-02 Exam - Topic 10 Question 90 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 90
Topic #: 10
[All PGCES-02 Questions]

The table "score" is defined as follows:

gid | score

-----+-------

1 | 70 1 |

60 2 | 100

3 | 80 3 |

50

The following query was executed. Select the number of rows in the result.

SELECT gid, max(score) FROM score GROUP BY gid HAVING max(score) > 60;

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Natalie
2 months ago
Definitely 2 rows, no doubt about it!
upvoted 0 times
...
Ma
2 months ago
Wait, are you sure? I thought gid 1 would count too.
upvoted 0 times
...
Tijuana
2 months ago
There are 3 unique gids in the table.
upvoted 0 times
...
Brett
3 months ago
Gid 1 has a max score of 70, so it should be included!
upvoted 0 times
...
Cherry
3 months ago
I think it’s 2 rows, only gid 2 and 3 have max scores > 60.
upvoted 0 times
...
Lorriane
3 months ago
If I recall correctly, gid 2 and gid 3 should both return max scores over 60, so that would be 2 rows, right?
upvoted 0 times
...
Samira
3 months ago
I’m a bit confused about the HAVING clause. Does it filter out groups that don’t meet the score condition?
upvoted 0 times
...
Solange
4 months ago
I remember practicing a similar question, and I think there were two groups with max scores above 60.
upvoted 0 times
...
Cherelle
4 months ago
I think the query groups by gid and then checks for max scores over 60, but I'm not sure how many actually meet that condition.
upvoted 0 times
...
Scarlet
4 months ago
Wait, I'm a little confused. Does the HAVING clause apply to the entire result set, or just to the groups? I want to make sure I'm interpreting that correctly before answering.
upvoted 0 times
...
Raul
4 months ago
Alright, I got this. The key is recognizing that the HAVING clause is filtering the groups, so I just need to count how many of those filtered groups there are. Easy peasy.
upvoted 0 times
...
Leigha
4 months ago
This looks straightforward enough. I'll just need to count the number of distinct gid values that have a max score greater than 60. Should be a pretty quick one to solve.
upvoted 0 times
...
Reyes
4 months ago
Okay, I can see the table structure and the query, but I'm a bit unsure about how the HAVING clause works here. I'll need to double-check my understanding of that before answering.
upvoted 0 times
...
Ronnie
5 months ago
Hmm, let me think this through. The query is grouping by gid and selecting the maximum score for each group, but only keeping the groups where the max score is greater than 60. So I'll need to carefully analyze the data to determine how many groups meet that criteria.
upvoted 0 times
...
Ling
5 months ago
I'm not sure, but I think the answer might be C) 3 rows.
upvoted 0 times
...
Jesusita
5 months ago
Hmm, this seems pretty straightforward. I'm going with B) 2 rows.
upvoted 0 times
Rory
1 month ago
I agree with Mona, B) 2 rows makes sense!
upvoted 0 times
...
Renato
2 months ago
I’m leaning towards C) 3 rows.
upvoted 0 times
...
Mona
2 months ago
No way, it's definitely B) 2 rows.
upvoted 0 times
...
Ernest
2 months ago
I think it's A) 1 row.
upvoted 0 times
...
...
Elenora
6 months ago
I agree with Dante, because there are 2 rows with a max score greater than 60.
upvoted 0 times
...
Dante
6 months ago
I think the answer is B) 2 rows.
upvoted 0 times
...

Save Cancel