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 2 Question 92 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 92
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 correct result value. SELECT score FROM score ORDER BY gid DESC, score ASC LIMIT 1;

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Norah
9 hours ago
Wait, isn't the lowest score 50?
upvoted 0 times
...
Ashton
6 days ago
Definitely going for option A!
upvoted 0 times
...
Cammy
11 days ago
The query sorts by gid DESC first.
upvoted 0 times
...
Sylvie
16 days ago
E) 100 is the way to go. This query reminds me of that time I had to debug a SQL statement at 3 am. Good times, good times.
upvoted 0 times
...
Carey
21 days ago
Haha, this query is like a puzzle! But the answer is clearly E) 100. I wonder if the exam writer was trying to trick us with that order by clause.
upvoted 0 times
...
Shawna
26 days ago
E) 100 is the right answer. This query is a good example of how the ORDER BY and LIMIT clauses can be used together to get the desired result.
upvoted 0 times
...
Jose
1 month ago
I think the query is a bit confusing, but the correct answer is definitely E) 100. The order by clause is a bit tricky, but it makes sense once you look at the data.
upvoted 0 times
...
Daren
1 month ago
I feel like the answer might be 50 since it's the only score associated with gid 3, but I'm not entirely sure.
upvoted 0 times
...
Salena
1 month ago
I remember a similar question where we had to order by multiple columns. I think the lowest score for the highest gid will be returned.
upvoted 0 times
...
Dorothy
2 months ago
I'm a bit confused about the ordering. Does it mean we should check the scores for gid 3 first?
upvoted 0 times
...
Jaime
2 months ago
I'm pretty confident the answer is E) 100. The query is sorting the rows in descending order by gid and then ascending order by score, so the last row with the highest score should be returned.
upvoted 0 times
...
Elly
2 months ago
Okay, let me walk through this step-by-step. The query is selecting the score column, ordering by gid in descending order and then score in ascending order, and limiting to 1 row. I think the answer is B) 60.
upvoted 0 times
...
Laine
2 months ago
The correct answer is E) 100. The query orders the rows by gid in descending order and then by score in ascending order, so the last row with the highest score is returned.
upvoted 0 times
...
Ayesha
2 months ago
I think it's A) 50.
upvoted 0 times
...
Emerson
2 months ago
I think the query orders by gid first, so we should look at the highest gid, which is 3.
upvoted 0 times
...
Raylene
3 months ago
I'm not sure about this one. The ORDER BY clause is throwing me off a bit. I'll need to double-check my understanding of how SQL sorting works.
upvoted 0 times
...
Werner
3 months ago
Hmm, I'm a bit confused about the ORDER BY clause. I need to think through how the rows will be sorted.
upvoted 0 times
...
Marvel
3 months ago
This looks like a straightforward SQL query, but I want to make sure I understand the logic correctly.
upvoted 0 times
Fabiola
3 months ago
I’m leaning towards 60.
upvoted 0 times
...
...

Save Cancel