Deal of The Day! 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

Posted by Vanna on Aug 18, 2025 at 12:09 PM

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;

Suggested Answer: C

Get Premium PGCES-02 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
22 comments · newest first
NA
Natalie 9 months ago
Definitely 2 rows, no doubt about it!
MA
Ma 9 months ago
Wait, are you sure? I thought gid 1 would count too.
TI
Tijuana 10 months ago
There are 3 unique gids in the table.
BR
Brett 10 months ago
Gid 1 has a max score of 70, so it should be included!
CH
Cherry 10 months ago
I think it’s 2 rows, only gid 2 and 3 have max scores > 60.
LO
Lorriane 11 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?
SA
Samira 11 months ago
I’m a bit confused about the HAVING clause. Does it filter out groups that don’t meet the score condition?
SO
Solange 11 months ago
I remember practicing a similar question, and I think there were two groups with max scores above 60.
CH
Cherelle 11 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.
SC
Scarlet 12 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.
RA
Raul 12 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.
LE
Leigha 12 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.
RE
Reyes 1 year 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.
RO
Ronnie 1 year 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.
LI
Ling 1 year ago
I'm not sure, but I think the answer might be C) 3 rows.
JE
Jesusita 1 year ago
Hmm, this seems pretty straightforward. I'm going with B) 2 rows.
RO
Rory 9 months ago
↳ replying to Jesusita
I agree with Mona, B) 2 rows makes sense!
RE
Renato 9 months ago
↳ replying to Jesusita
I’m leaning towards C) 3 rows.
MO
Mona 10 months ago
↳ replying to Jesusita
No way, it's definitely B) 2 rows.
ER
Ernest 10 months ago
↳ replying to Jesusita
I think it's A) 1 row.
EL
Elenora 1 year ago
I agree with Dante, because there are 2 rows with a max score greater than 60.
DA
Dante 1 year ago
I think the answer is B) 2 rows.
0/2000 characters

Save Cancel