I can get names of all badges using following query in http://data.stackexchange.com/.
SELECT DISTINCT Name FROM Badges
I need to apply a filter on the query to list only the gold badges. How can I write the query?
I went looking for this after you asked on Meta Stack Overflow, and from looking at the Database schema documentation for the public data dump and Data Explorer there doesn't seem to be an easy way to query for badges per class. The badges table schema is:
- UserId, e.g.: "420"
- Name, e.g.: "Teacher"
- Date, e.g.: "2008-09-15T08:55:03.923"
Since you are only interested in gold badges, and there aren't that many of them, the simple solution would be to hardcode their IDs in your query.
If you want a distinct list of the gold badges its available here : https://softwareengineering.meta.stackexchange.com/badges?tab=general&filter=gold