You are here
Home > SQL > Query Stack Overflow With T-SQL – Give Your Queries A Workout

Query Stack Overflow With T-SQL – Give Your Queries A Workout

Query Stack Overflow – Do you wish that you could run a few queries against a truly huge database? Do you want to tune your queries and see how they match up against some big data? Sometimes we need a big database for research reasons (here’s looking at the educators in countless universities across the world, educating our young IT minds). Well cast AdventureWorks aside (for now). Query Stack Overflow database directly.

Query Stack Overflow

To do this, head on over to the following URL: https://data.stackexchange.com/ and you will see the various sites that you can query. Each site has a list of statistics which make it useful for you to determine which one to query. Stack Overflow has almost 7 million questions with 12 million answers!

Query Stack Overflow

I therefore want to query the Stack Overflow database, so click on the Stack Overflow name next to the icon.

Query Stack Overflow

On the following screen, you will see all the queries. We want to create our own, so click on the ‘Componse Query’ button. This takes you to the query screen where you can create your new SQL query.

Query Stack Overflow

To the right of this screen, is the Database Schema panel. This lists all the database tables and fields along with their datatypes. In our case, we want to query the Users table.

Query Stack Overflow

Give your Query a name. I wanted to see who was the most prolific user according to their reputation. I therefore chose the Query Title to be Rock Star User.

Query Stack Overflow

When you have added the T-SQL to the query window, click on the ‘Run Query’ button.

Query Stack Overflow

The result from my query comes as no surprise either. Jon Skeet is the user with the highest reputation.

DZone

Dirk Strauss
Dirk is a Software Developer and Microsoft MVP from South Africa. He loves all things Technology and is slightly addicted to Twitter and Jimi Hendrix. Apart from writing code, he also enjoys writing human readable articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has yet to master.

Similar Articles

Top