Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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
up vote 22 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, plus how to use SODDI to import the XML dump into SQL Server and query it.

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

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

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. – Timothy Carter Jul 2 '09 at 15:09

You must log in to answer this question.

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