Skip to main content
3 of 6
added 75 characters in body
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, with further tricks to keep syntax highlighting from doing weird things. This is tedious and slow to do, both for askers and answerers.

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 a nice tabular format that is easier for new users to discover. Preferably something that also wraps properly on the mobile app. Ideally the ability to copy/paste from the common query tools... perhaps a "paste data" button on the toolbar that evaluated the clipboard contents to create a nice table.

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