-17

I'd like to answer more SQL questions, but it is hard to do so without the ability to test. And it is pretty laborious for me to create a database to answer a single question. I'm aware there's SQL Fiddle, but it would be good if SO could allow some method of creating a database in the question to allow the questioner to either create a database of sorts in the question or give the person answering the question a way to better help them.

Is the only answer for the user to put in their Create statements?

Questions involving database queries - can we make it easier for people to create well-formatted data for testing

10
  • 2
    I got a downvote in less that 57 seconds. New record for me.
    – johnny
    Commented Feb 10, 2016 at 16:37
  • 2
    Heh. We're dedicated like that. Commented Feb 10, 2016 at 16:38
  • 1
    Yes, it is very encouraging.
    – johnny
    Commented Feb 10, 2016 at 16:38
  • 6
    It only means we disagree with your feature request, nothing more. Commented Feb 10, 2016 at 16:38
  • Well, you are aware of the only proper answer already: Create-statements and the like to create a database with the proper layout and contents, if needed. That's part of creating an MCVE. Commented Feb 10, 2016 at 16:39
  • @FrédéricHamidi I guess that's different from the regular SO questions, then. I was not aware.
    – johnny
    Commented Feb 10, 2016 at 16:40
  • @Deduplicator I hate to ask this, but what is MCVE?
    – johnny
    Commented Feb 10, 2016 at 16:42
  • 1
    Well, if this was on main I would have linked it like this: [mcve] Anyway, here it is: stackoverflow.com/help/mcve Commented Feb 10, 2016 at 16:45
  • I has a sad because of that question :( meta.stackoverflow.com/questions/313675/…
    – Gimby
    Commented Feb 10, 2016 at 17:05
  • 1
    Did you know about sqlfiddle.com ? I never used it, but it may help you. Commented Feb 10, 2016 at 17:05

2 Answers 2

5

As someone who has answered a lot of questions on the site, I wish this was something that was implemented, but it's not feasible.

There are external tools that can be used to do this including:

and probably others. These will allow you to create tables, run queries, etc. and then you can post a link to it inside your answer.

Creating servers to run a variety of RDBMS platforms is not something we're able to do at this time, so this is .

10

It's too complex to expect Stack Overflow to supply an entire DBMS for a question or two. Here are some reasons I can think of off the top of my head:

  • The specific version of their DBMS may be proprietary
  • The specific version may be difficult or cumbersome to install
  • There may be specific configuration settings or tuning that would impact the result of the query or its performance

Notwithstanding that I too agree that the OP needs to supply the data as part of their question, asking Stack Overflow to supply a blank database would be too much of a lift. If you want to answer the question but you don't have the right DBMS to answer it with, be very careful about that as you may be rightfully called out for having bad SQL syntax or performance.

6
  • Don't take this wrong. I don't know how to ask it, but how do you (or anyone) know it would too much of a lift? I thought SO guys could do anything.
    – johnny
    Commented Feb 10, 2016 at 16:41
  • I'm not speaking as anyone that even comes remotely close to working for Stack Exchange, but if I were working there, I'd think it'd be a bit much for right now. All things considered, there are a lot of other conditions, states, configurations, and the like that would make setting up a test database that requires that fairly complex. Besides, I still feel like if you want help with your database against a specific set of data, you should provide the specific set of data.
    – Makoto
    Commented Feb 10, 2016 at 16:45
  • I'm not suggesting they don't provide the data. I'm suggesting SO provide the mechanism to provide the data. The data is usually presented. It's not presented in a way I can test it unless the SQL Create statements are given.
    – johnny
    Commented Feb 10, 2016 at 16:52
  • 3
    In that case, and at that instant, this is a failing of the OP to provide enough context to answer the question. If they don't include their data, their question should be put on hold until they do so.
    – Makoto
    Commented Feb 10, 2016 at 16:53
  • 2
    I'm sorry, but the whole idea seems preposterous to me. Such systems cannot be tested/debugged/whatever on a Q&A blog. Any question that appeared with 'real' datasets and tables appended I would immediately close as 'too broad'. Commented Feb 10, 2016 at 17:20
  • 1
    @MartinJames: It's not unrealistic to assume that there is more than one person running a copy of Access...and besides, if it can be answered with what's presented in the question, there's no reason to close it.
    – Makoto
    Commented Feb 10, 2016 at 17:22

You must log in to answer this question.

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