Querying means asking questions. Listed below is a sample scenario based upon a typical day that will help you better understand how queries work.
You and a few college friends (Bob and Sue) have decided to go out to lunch together. But where are you going to eat? You have a meeting at 1pm, which means that you have to be back in the office by 12:45pm. With this information in mind, you have asked that Bob and Sue pick a restaurant that is less than 5 miles from your house and that serves food fairly quickly (within 10-15 minutes). Bob tells you that he is allergic to seafood and Sue tells you that she is a vegetarian and wants to spend less than $15 for her meal. Having the above information will allow you, Bob, and Sue to narrow down and possibly find a restaurant that you can all agree upon.
- Post a real world scenario such as the sample listed above where you have to ask yourself (or others) questions that will help narrow down the results to a few selections. Use a different real world scenario from your classmates!
- How does this relate to using a query within a database? What would be your primary table? What would be the criteria for your query? What are you querying for and why?