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 Exam PGCES-02 Topic 2 Question 65 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 65
Topic #: 2
[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: A

Contribute your Thoughts:

An
13 days ago
This is a tricky one! I'm going to go with option B) 2 rows. The query is pretty straightforward, but you have to pay attention to that HAVING clause. And hey, at least it's not as confusing as that 'SELECT DISTINCT' question from last time, right?
upvoted 0 times
...
Latricia
16 days ago
Hmm, let me think this through. The table has 5 rows, and the query is grouping by gid, so there will be 3 groups. But the HAVING clause is filtering out the groups where the max score is less than 60, so the answer must be 2 rows.
upvoted 0 times
Jerrod
2 days ago
I think the answer is B) 2 rows.
upvoted 0 times
...
...
Layla
19 days ago
I'm pretty sure the answer is 2 rows. The table has 5 rows, but the query is only selecting the groups where the max score is greater than 60, and there are only 2 such groups.
upvoted 0 times
...
Ronald
25 days ago
The query is grouping by gid and selecting the maximum score for each group, but it's also filtering out the groups where the maximum score is less than 60. So, the result should have 3 rows, one for each group with a max score greater than 60.
upvoted 0 times
Josphine
9 days ago
A) 1 row
upvoted 0 times
...
...
Hyman
1 months ago
I'm not sure, but I think the answer might be C) 3 rows because there are 3 unique gid values with max score greater than 60.
upvoted 0 times
...
Tracey
2 months ago
I agree with Enola, because there are 2 rows where the max score is greater than 60.
upvoted 0 times
...
Enola
2 months ago
I think the answer is B) 2 rows.
upvoted 0 times
...
Tori
2 months ago
I'm not sure, but I think the answer might be C) 3 rows because there are 3 unique gid values with max score greater than 60.
upvoted 0 times
...
Annamaria
2 months ago
I agree with Gayla, because there are 2 rows where the max score is greater than 60.
upvoted 0 times
...
Gayla
2 months ago
I think the answer is B) 2 rows.
upvoted 0 times
...

Save Cancel