Query Exercise: Find Recent Superstars


For this week’s Query Exercise, we’re working with the Stack Overflow database, and our business users have asked us to find the new superstars. They’re looking for the top 1000 users who were created in the last 90 days, who have a reputation higher than 50 points, from highest reputation to lowest.

In your Stack Overflow database, create just these two indexes:

EXEC DropIndexes; GO CREATE INDEX CreationDate ON dbo.Users(CreationDate); CREATE INDEX Reputation ON dbo.Users(Reputation);

And then write the query. Now, because you’re all using different copies of the Stack Overflow database, with different end dates, find the most recently created