Skip to main content
1 of 6
Joel Coehoorn
  • 414.6k
  • 5
  • 24
  • 24

Better support for sample data and perhaps table schemas in SQL questions

I've been around SO since almost the beginning, and in that time I've answered a LOT of SQL related questions. One point of pain in this area has always been posting sample data or query results. We've had to use ascii table formatting in <pre> blocks or indented for code blocks. This is tedious and slow to do, both for askers and answers.

This was asked about and declined previously. Many more times than that, I'm sure. But that was back in 2010. And for nearly 8 years now I've been content to leave it at that.

I'm bringing this up again because I've experienced a disturbing trend where it seems that questions increasingly include a screen-capture from sqlPlus or Management Studio, rather than real sample data. I've noticed this more in other areas, too, and we may want to think about treating images in posts as a potential signal for low-quality generally, as well as a way to address that, but for the moment I want to think about SQL questions.

We could really use an easier method for getting sample data or results into Stack Overflow in nice tabular format that is easier for new users to discover.

This isn't a new request, but I believe it is something that has sat idle for a while and may deserve a new look.

Joel Coehoorn
  • 414.6k
  • 5
  • 24
  • 24