I think you're raising an interesting point that shows the tensions between the multiple goals and mechanisms of Stack Overflow.
On the one hand, it wants to be a repository of knowledge. On the other hand, it says that "Ask questions, get answers, no distractions". Trying to separate one aspect from the other too strictly simply does not work.
Questions are the seeds of any good Q&A thread on Stack Overflow. Hence, Stack Overflow generally wants questions. Questions themselves tend to come from problems users face: a user not facing a problem will quite simply not ask a question about that problem.
However, the idea is that questions are also meant to be sufficiently generic so that they can be searched for and be useful to others. This is where it becomes tricky.
- A question with too many details regarding what you've wrongly tried will be far less generic. Some of these attempts could just be distractions. Other attempts might be good, if others make similar attempts and also search for those errors to land on that question.
- Askers often use incorrect terminology (simply because they don't know, that's why they're asking the question indeed), so answers sometimes have to do a bit of "concept mapping" to provide an adequate solution.
- Duplicate questions tend to be closed, pointing to a more generic question (we call some of them "canonical" questions), yet the explanations in the answers to the target question can be quite far away from the vocabulary used to describe the problem in the newer question.
The idea of providing too many details on your environment and what you've tried can play against the generalisation of the question unfortunately (so answerers could have to write little variants of very similar, but distinct things).
This is all a very fine balancing act, especially since you need to take into account the possible level of speciality you can expect from others reading that question later.
Assuming that Stack Overflow is primarily a repository of knowledge is difficult, because all the mechanisms are biased towards making it a Q&A site, where you get points for asking question and answering them. There is virtually no incentive for collaborative work towards a "greater good".
However, if you think of Stack Overflow as somewhere where you can get help, with the secondary effect of gathering useful knowledge, the mechanisms make more sense. Deep down inside anyone who asks a question does so because they'd like some help. From a "repository of knowledge" point of view, we are grateful to those who can ask good questions. From your point of view as an asker in need of help, putting as many details as you can will increase your likelihood of getting a suitable answer. From a "repository of knowledge" point of view, this will generally have the side effects of making the Q&A thread more interesting and relevant to anyone reading it. So yes, generally, as an asker, give an indication of what you've tried so that answerers don't have to anticipate all the possibilities (some of which may be completely irrelevant) and so that they can tailor their answers to the question, which makes the Q&A as a whole a more useful and meaningful block of information.
The problem in the question you mention is that the asker has done visibly very little research, in that you'd probably find this sort of information in a SQL book or tutorial.
Where I think there is a place for such questions is that we don't necessarily want the repository of knowledge we build to be a "dead" repository, where someone answers are collectively provided in a way that eventually becomes detached from questions. An encyclopaedia is also a repository of knowledge, but it will present you the information in the way it sees fit: getting to the right knowledge is difficult if you don't know what to look for, and there's generally no where you can ask.
In contrast, the strength of Stack Overflow is that we can actually tailor answers to problems, as they are expressed. In that sense, entry-level questions are not necessarily bad. They are however a real problem because of a lack of resources: there isn't an unlimited pool of answerers willing to spend their spare time answering for free what askers could have found if they'd spend a few hours reading a book. This is why there is a requirement to "demonstrate a minimal understanding of the problem being solved"