You work as a SQL Server 2012 database developer at ABC.com. You are developing a query for
a database driven Web application that allows visitors to vote for the cricket player of the week.
The number of votes is stored in a table named WeeklyVotes that has columns named Week,
PlayerName, Votes.
You need to write a Transact-SQL query that returns the cricket player that received the most
votes for each week, as well as the number of votes they received.
Which of the following SELECT statement would accomplish this task?

A.
SELECT PlayerName, Votes
FROM ( SELECT PlayerName, Votes,
RANK () OVER (PARTITION BY PlayerName ORDER BY Votes ASC) AS Rank
FROM WeeklyVotes ) AS tmp
WHERE Rank = 1
B.
SELECT PlayerName, Votes
FROM ( SELECT PlayerName, Votes,
RANK() OVER (PARTITION BY Week ORDER BY Votes DESC) AS Rank FROM WeeklyVotes)
AS tmp
WHERE Rank = 1
C.
SELECT PlayerName, Votes
FROM ( SELECT TOP 1 PlayerName, Votes,
RANK () OVER (PARTITION BY PlayerName ORDER BY Votes ASC) AS Rank
FROM WeeklyVotes
ORDER BY Rank) AS tmp
D.
SELECT PlayerName, Votes
FROM ( SELECT TOP 1 PlayerName, Votes,
RANXO OVER (PARTITION BY PlayerName ORDER BY Votes DESC) AS Rank
FROM WeeklyVotes
ORDER BY Rank) AS tmp
Explanation:
Option B
0
0
B, tested
0
0
The facts talked about within the write-up are several of the most effective available.
0
0
Below you will find the link to some sites that we assume you should visit.
0
0
we came across a cool internet site which you may possibly love. Take a look when you want
0
0
usually posts some pretty intriguing stuff like this. If youre new to this site
0
0
Every as soon as inside a though we pick out blogs that we study. Listed beneath are the most current web sites that we pick
0
0
the time to study or take a look at the material or web-sites we have linked to beneath the
0
0
Here is a superb Blog You may Uncover Interesting that we Encourage You
0
0
Here are a few of the web pages we advocate for our visitors
0
0
usually posts some pretty intriguing stuff like this. If you are new to this site
0
0
one of our visitors just lately encouraged the following website
0
0
The data talked about inside the post are a few of the very best readily available
0
0
Many thanks really beneficial. Will share site with my good friends
madden nfl 17 coins http://www.reflex-gaming-clan.de/index.php?site=profile&id=123249
0
0
Here is a great Blog You might Obtain Interesting that we Encourage You
0
0
although sites we backlink to beneath are considerably not associated to ours, we feel they may be really worth a go via, so possess a look
0
0
one of our visitors just lately advised the following website
0
0
we came across a cool web site that you just might delight in. Take a search when you want
0
0
we prefer to honor quite a few other online web-sites on the internet, even though they arent linked to us, by linking to them. Beneath are some webpages really worth checking out
0
0
just beneath, are various absolutely not connected sites to ours, nonetheless, they’re certainly really worth going over
0
0
the time to study or stop by the subject material or websites we have linked to below the
0
0
check below, are some entirely unrelated web sites to ours, however, they’re most trustworthy sources that we use
0
0