What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

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.

share|improve this question

4 Answers 4

up vote 19 down vote accepted

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.

share|improve this answer
5  
I'm not sure those links are valid anymore. They both now point at toadworld.com/platforms/sql-server/w/wiki/default.aspx –  Joel B Jun 21 '13 at 14:58
    
@JoelB: this appears to be an updated link to the 2nd article: toadworld.com/platforms/sql-server/w/wiki/… –  User Dec 29 '13 at 3:32
    
linked urls are dead :( –  rochal Jan 30 at 23:58

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).

share|improve this answer

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?

share|improve this answer
    
This weeks podcast speaks greatly to Joel's resistance to releasing things to the public because of StackExchange. Understandably so I would say. blog.stackoverflow.com/2009/07/podcast-60 –  Timothy Carter Jul 2 '09 at 15:09

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.

share|improve this answer

You must log in to answer this question.

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