Jeff Smith Blog

Random Thoughts & Cartesian Products with Microsoft SQL Server

Need an Answer? Actually, No … You Need a Question

Welcome!

The reason you were directed here is because you need assistance, and I am here to help.  I am not, however, here to provide you with any answers!  You see, it looks like the assistance you need is not finding an answer; it is rather that you need assistance finding a question.

As you know, there are all kinds of questions.  Questions that test memory recall.  Questions that test logic skills.  Brain-teasers and mathematical questions and so on.  But there is one requirement that all good questions must have in common before they can be answered:

A proper question MUST provide ALL of the information necessary in order for an answer to be given. 

In other words, if you omit important information from a question, it doesn't matter how simple or easy that question is:  It suddenly becomes very difficult, or even impossible, to answer. 

For example, consider the following question:

"Am I wearing a hat?"

Seems pretty easy, right? No logic, no memorization, no trivia, no knowledge of any specific topic is required. 

So ... what's the answer?  Take a few minutes, think about it, write it down on a piece of scrap paper.  I can wait, take your time ...

What's that, you say? You can't answer that simple question!?  Why not?  I stated it very clearly, it requires a simple YES or NO response, there's nothing tricky there.  So, why would anyone have any trouble giving an answer to something so basic and simple?

The reason, of course, is because you can't see me.  You have no way of knowing what I am wearing because I did not provide you enough information!  As simple as it is, it cannot be answered; therefore, it is not a proper question!

Suppose, instead, I provided a picture of myself and asked "In this picture, am I wearing a hat?"  And, in the picture, my head is clearly visible and the fact that I am wearing a Boston Red Sox cap is very clear.  Would you be able to answer the question in that scenario?  Of course!  Suddenly, what was an impossible question to answer became very simple! 

How did that happen?

It happened, of course, because I provided you enough information to answer the question!  And that is the often problem with many of the questions we see day to day in forums asking for help.  You cannot expect an answer unless you provide a proper question with all the necessary information.  The majority of the effort by those helping others in these forums is not spent answering questions, it is spent trying to figure out what the heck the question actually is!  And that is the problem; people don't seem to realize that they can't just randomly cut and paste code or ask vague questions without any context and expect to receive help! 

Yet, requesting more information and details doesn't always go over so well ... Those looking for help seem to often have trouble understanding why the helpers need more info, why are they are so "anal" and "demanding" about minor things like database schemas, or sample data, or code samples.  "How is that important?" they wonder. "Just answer the question and provide me with some help, please!  An expert would know the answer!"

My goal today is to hopefully help you to understand why information and context is so important for even simple, basic, questions, and how providing that information suddenly transforms a poor question into a very good one that can be quickly and accurately answered. 

Let's try another example:

"How do I get from work to Fenway Park?"

So, what do you think?  Is that a good question that provides all of the information?  It seems simple, right? It is just asking for basic directions. Yet, where is "work"?  Is it asking for driving directions, or walking directions, or maybe which subway lines to take?  Who knows!!?

As stated, this question simply cannot be answered!   Yet, if I just  thought about it a little and made sure to provide all of the necessary information, this "impossible" question with no answer suddenly becomes a very simple one:

"How I do get from 125 High Street, Boston, MA to Fenway Park via the subway?"

See the difference? Instead of just assuming that everyone knows where I work and what mode of transportation I am looking for, if I make sure to simply tell them, there is no uncertainty, no confusion, no guesswork, and the question can be answered.  This isn't rocket science, right?  Yet, these common-sense basics seem to elude many, many, people!

Would you drop your car off at a mechanic with a note on it that says:

"Car doesn't work.  Plz fix.  It is urgent! Thx!!"

I sure hope not.  You'd explain what's wrong, right?  It has trouble starting, it has a flat tire, there's smoke coming from beneath the hood, the steering wheel fell off, and so on. It's basic common sense that you would do everything you can to be sure that the mechanic has the information he needs to fix your car correctly and promptly, right?  Shouldn't that same logic also apply when asking for help in forums?

Finally, let's try a SQL Server question:

"What is wrong with teh codez? it does not work!  Plz Help!

select SaleID, Customer, Qty, Price
from SalesNumbesr

Thnx!"

Take a look at that question.  It is a very simple SQL statement, right?  There's nothing there that a beginner could not understand.   Can you "spot" the problem and fix it? 

Hmmm ... maybe you can, maybe you can't.  You can't really be sure, can you?  At this point, we can all try to guess what the problem is.  What does "it does not work" even mean? Is "SalesNumbesr" a typo?  Should it be "SalesNumbers" ?  Is it returning too much data?  not enough data?  Incorrect data?  Is it generating an error?  And so on. 

We could spend all day trying to guess what the question is and provide answers to those guesses, but if the guesses are wrong, the answers won't be so helpful, will they?  On the previous question, what if you guessed that I work in Cleveland and provided directions for me to Fenway Park from there?  Would that be helpful to me? Probably not, right?  Most likely, it just wasted everyone's time.

So, getting back to the code .... what is wrong with it?  Well, in SQL terms, the answer is: NULL!  It does not exist.  Until we are provided with more information, the question cannot be answered. Thus, it is not a question at all, just an incomplete fragment.  As simple as the question looks, as basic as the T-SQL is, this "question" will stump even the greatest "experts" out there because an answer to this question simply does not exist.

If more information is provided, like this:

"Hi -- I currently have the code below:

select SaleID, Customer, Qty, Price
from SalesNumbesr

I would also like to return the total Amount for each Sale, which is the Qty multiplied by the Price.  However, I am not sure how to add this to my current code.  Can anyone please help?"

Suddenly, the question now is very clear and the answer is very simple!  They just want to know how to add an expression to the result set. Just by providing a little more information, and not assuming that everyone knows what is happening outside of the context of what was written, something that was impossible to answer has become very easy. 

I sure hope this is making sense.

In fact, taking this whole article to its logical conclusion, I think we can safely say:

"The more accurate and detailed information a question provides, the more accurate and detailed the answers will be."

In other words, a vague, incomplete question can only get, at best, vague, incomplete answers.  But a question that spells out the entire situation very clearly will get, at best, a very clear and specific answer that works in that situation. 

So, please, think of this when you ask questions in a forum.  Consider the fact that no one knows your specific environment, or code, or application, or database except for YOU.  And, no one can help you unless you are providing enough information for them to do so. 

Just like the mechanic. Or someone giving driving directions.  Or a doctor when you are sick.   You provide them with the necessary information so they can help you, right?  Consider doing the same to those providing you with (free!) programming advice.

. . .

(Feel free to provide this link to those who seen to have trouble understanding that you cannot read their mind when assisting them with programming help on forums.)

Legacy Comments


Tara
2008-05-13
re: Need an Answer? Actually, No ... You Need a Question
experts olny plez

;-)

Tara
2008-05-13
re: Need an Answer? Actually, No ... You Need a Question
My first candidate:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=102770

Jeff
2008-05-13
re: Need an Answer? Actually, No ... You Need a Question
Well done, Tara!!

:)

Graz
2008-05-13
re: Need an Answer? Actually, No ... You Need a Question
Oh Tara! You made my day!

poots
2008-05-14
re: Need an Answer? Actually, No ... You Need a Question
Jeff - great article - you are of course preaching to the choir when it comes to your regular readership. But I think 90% of those that need to read it won't do so because of its length. Any chance of an abridged version one day? :)

Jeremy Simmons
2008-05-15
re: Need an Answer? Actually, No ... You Need a Question
Here's your abbridged version poots.
http://www.sellsbrothers.com/spout/archive.htm#teddybear

I remember asking Jeff to give me a question to my problem about 13 months ago.
http://weblogs.sqlteam.com/jeffs/archive/2007/04/05/check-constraints.aspx

Thanks for your sage advice friend. Truely a gentleman and a credit to your gender.

Henri
2008-05-22
re: Need an Answer? Actually, No ... You Need a Question
Hi Jeff,

--
Am I wearing a hat?

Suppose, instead, I provided a picture of myself and asked "In this picture, am I wearing a hat?" And, in the picture, my head is clearly visible and the fact that I am wearing a Boston Red Sox cap is very clear. Would you be able to answer the question in that scenario? Of course! Suddenly, what was an impossible question to answer became very simple!
--

Define hat :-) I wouldn't call a cap a hat. So I would not be able to be sure to provide a correct answer.

Good article... A good consultant should ask for the reasons behind the questions to get the right (real) questions.

Henri



Manie Verster
2008-05-26
re: Need an Answer? Actually, No ... You Need a Question
Hi Jeff,

I am a South African of Afrikaans (Dutch dialect) speaking origin. We have a saying in Afrikaans that says (directly translated) the last ox also get in the pen (corale?). I know this is already old but I only got a chance now to deliver my comment.

In a previous item in your blog you spoke about people that do not want to help themselves but wants to be spoonfed. Isn't this also a good example of that. Look, I am no expert where it comes to being a dba but I know sql code pretty well. You can see when someone is making an effort to get something done. Some people expect miracles and think that by giving as little info as possible, they can get the most as possible.

I feel, however, that we that know should help them right and that is why I think you are doing a terrific job with your blog. Thanks a lot, man!!!

Gints Plivna
2008-05-28
re: Need an Answer? Actually, No ... You Need a Question
I'd like to add to articles for further reference. The first is classical How To Ask Questions The Smart Way which is quite detailed and discusses many aspects of this subject. Probably SQL Server adepts won't like some parts of it especially this the one in Questions not to ask chapter ;)
"Q: I'm having problems with my Windows machine. Can you help?
A: Yes. Throw out that Microsoft trash and install an open-source operating system like Linux or BSD."

And the second one is blog entry by Thomas Kyte and the best thing written there I think is the suggestion Provide the Setup data in a useful format i.e. if one needs a specific query then he should provide CREATE TABLE and INSERT scripts. Using them it is much easier for other people to write real queries and test them on their systems. The blog entry actually is about Oracle DBMS but I think it is relevant for each and avery DBMS.

LTack
2008-07-02
re: Need an Answer? Actually, No ... You Need a Question
Haha, nice. *bookmarks*

Frank
2008-10-20
re: Need an Answer? Actually, No ... You Need a Question
How do i get a good girlfrind ?

SHAILESH
2008-11-06
MYSQL to MS SQL migrate
Hi ,

I have a doubt. My company database is in MYSQL.
Now we want to switch all data into SQL Server 2008.
I am not getting any answer that how will I convert this?

I can do this but that a long procedure (First create table exactly same as in MYSQL then by ssis or dts we can do this)

CAn you help me or tell me any other method?

Waiting for your reply.

Thanks
Shailesh


idrees
2008-11-12
plz solve my question
"give me a sorce file this question" "java question"

(i)declare a class, calArea, with length and width as its mambers of type double.the class should define ane constructor to initialize the instance variables length and width.the class will have one more constructor to accept two values and asign them to length and width respectively. further the class should define two methods-area() and display(). the area() method should compute the area and return it. the display() method will be used to display the returned value.

(ii)write a class called distance which has two members feet and inches of type double. define a method calculate() to accept a value indicating number of inches, and display the corresponding value in feet (and inches).



"please quickly answer"

pankaj
2008-11-22
re: Need an Answer? Actually, No ... You Need a Question
i am visual studio 2008 for making asp.net pages and sql server2005.my question is when i start microsoft sql server management studio express to make databae file , a diloge box appear on the screen and want me to enter server name and type ,i am using winxp operating system plz.. tell me what is the name and type of server.

itay
2008-12-29
i liked it. thanks.
i liked it alot, thanks for sharing.

visit me at my own new blog
http://sql-insights.blogspot.com/

itay

bbq
2009-02-17
re: Need an Answer? Actually, No ... You Need a Question
that was a good 1
lmao

Brian H.
2009-04-01
re: Need an Answer? Actually, No ... You Need a Question
Why are you trying to help people who are so clueless that they would ask the type of questions you complain about? You're just helping perpetuate the incompetence that exists in this industry. Let the idiots NOT get help and hopefully leave the profession.

convert inches to cm
2009-05-20
re: Need an Answer? Actually, No ... You Need a Question
Well done, Tara!!

sushant
2009-06-29
re: Need an Answer? Actually, No ... You Need a Question
Hi ,
I am new in database designing. Wright now I am working on one project but I am unable to create well defined relationship for following problem. I hope you will definitely help me to crack this nut
Thanks in advance
Problem
1. There are customers, every Customer is either local or overseas

2. There is Quality Master and Design Master

3. Quality and Design forms one product

4. Local customers having same price tag for same product
(Ex. LocalPrceListMaster contains QualityMasterId, DesignMasterId and Price)

5. Overseas customer can have different price tag for same product ( Ex. OverseasPriceListMasterCustomomerWise contains QualityMasterId, DesignMasterId, Price and CustomerId)

6. All types of customer can have his own Catalogue’s.

7. Catalogue contains, some of the or all products from one of the PriceListMaster
(
If Catalogue is for Local customer then it will contain items from LocalPrceListMaster.
If Catalogue is for overseas customer then it will contain items from OverseasPriceListMasterCustomomerWise
)
Note
1. Tables ( table names and structures) are defined for understanding purpose
2. If is there any need then you can change it.

How to implement above relationship



Dlozi
2009-08-20
SSRS
Hi Jeff,

This is good,especially for Junior DBA's like me,now I have a good idea on how to ask a question.
Most of us use assume that you will understand what I'm talking about.

Thanks
Dlozi

MarkO
2009-08-20
re: Need an Answer? Actually, No ... You Need a Question
It should be noted that the process of asking a complete, sufficient question can itself provide the answer. Twice in the past I've started to post a knotty problem to a forum, only to have the answer emerge from the thought I put into ensuring the question was good.

-MarkO

Brett
2009-10-02
OMG
WAIT...you're suppose to think about what you're asking in the first place?