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 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
Jordan
24 hours ago
Definitely E) 100, it’s the highest!
upvoted 0 times
...
Jerry
6 days ago
I’m leaning towards D) 80.
upvoted 0 times
...
Lezlie
11 days ago
I feel like it’s C) 70.
upvoted 0 times
...
Devora
16 days ago
No way, it's B) 60!
upvoted 0 times
...
Thad
22 days ago
100 is the highest, but it won't be the answer here.
upvoted 0 times
...
Laurel
27 days ago
I think it's B, but I'm not sure.
upvoted 0 times
...
Norah
2 months ago
Wait, isn't the lowest score 50?
upvoted 0 times
...
Ashton
2 months ago
Definitely going for option A!
upvoted 0 times
...
Cammy
2 months ago
The query sorts by gid DESC first.
upvoted 0 times
...
Sylvie
2 months 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
2 months 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
2 months 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
3 months 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
3 months 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
3 months 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
3 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
3 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
3 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
4 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
4 months ago
I think it's A) 50.
upvoted 0 times
...
Emerson
4 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
4 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
5 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
5 months ago
This looks like a straightforward SQL query, but I want to make sure I understand the logic correctly.
upvoted 0 times
Fabiola
4 months ago
I’m leaning towards 60.
upvoted 0 times
...
...

Save Cancel