FAQ: Window Functions - RANK

This community-built FAQ covers the “RANK” exercise from the lesson “Window Functions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Analyze Data with SQL

FAQs on the exercise RANK

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

For Windows Functions: Rank, why would someone use Row instead?

Hi! I’m unfamiliar with ranking and was surprised to learn that a two-way tie at 7 skips 8, and the next ranking is 9. Would a three-way tie at 7 skip 9 also, making the next ranking 10, or does it always skip one ranking regardless of how many rows are tied?

Thanks!

Yes it would skip as many as there are tied ranks (not just a single jump). It might help if you treat it like a competitive league table or similar, e.g.

Team Score Position
A 120 1
B 80 2
C 80 2
D 80 2
E 35 5

A came 1st with a score of 120. B, C and D all have equal scores of 80 and are joint second place. E is in 5th place with a score of 35; in table form this might seem a little clearer as E is the 5th team.

1 Like

@tgrtim Thank you, that’s super helpful! I clearly haven’t spent a lot of time around competitive things since this is entirely news to me :slight_smile:

1 Like

Potential typo in step 1: “What happened to our first 3 results?”
The hint text then references rows 7 and 8.

Had me worried since my first 3 results (rows 1 - 3??) didn’t change.