ผู้ใช้จัดอันดับตามจำนวนป้าย (ทุกประเภท) ไม่จำเป็นต้องใช้ทุกตาราง
Users ranked by number of badges (all kinds).It is not neccessary to use all the tables.
 Users:  Id [ number]  Reputation [ number]  CreationDate [ time]  DisplayName [ text]  LastAccessDate [ time]  WebsiteUrl [ text]  Location [ text]  AboutMe [ text]  Views [ number]  UpVotes [ number]  DownVotes [ number]  ProfileImageUrl [ text]  EmailHash [ text]  AccountId [ number] 
SELECT UserLink AS "user_link", Rep, NumBadges, COUNT(*) AS "numquestions" FROM (SELECT * FROM (SELECT Users.Id AS "userlink", Users.Reputation AS "rep", COUNT(*) AS "numbadges" FROM Users INNER JOIN Badges ON Users.Id = Badges.UserId WHERE Badges.Class = 1 GROUP BY Users.Id, Users.Reputation) AS UserByBadge ORDER BY NumBadges DESC LIMIT 100) AS UserByQuestion INNER JOIN Posts ON Posts.OwnerUserId = UserLink WHERE Posts.PostTypeId = 1 GROUP BY UserLink, Rep, NumBadges ORDER BY NumBadges DESC