Has the database schema for Stack Overflow been made publicly available? If not, could it be?

If not the whole schema, how about a list of the tables used?

I want this as a learning resource.


4 Answers 4


Not the whole schema, but we've documented the contents of the database export schema.

Here's how to import the database dump into SQL Server, which includes table creation statements. I explain how to use http://Data.StackExchange.com, plus how to use SODDI to import the XML dump into SQL Server and query it.


Have you looked at the data dump yet? I know it is not 100% complete, but I would think it would give you a reasonable starting place.


Also, recently they refactored the entire database, de-normalizing it some and duplicating columns across tables to minimize joins and speed up queries. So if you did see it, you'd probably think it was amateur because of the dupe columns. It wouldn't be a good learning point (unless you started with the old version, and saw the queries they improved by moving to the new version).


I don't think they will ever really do this because there is a lot of money invested in it as well as the StackExchange framework.

I will imagine there will be more details, though, in the future when they release an official API to work with certain areas of the database.

Edit as Rich B said, there is also the data dumps, which displays a lot of what you may be looking for?


Not the answer you're looking for? Browse other questions tagged .