Query

280 views

Published on

  • Be the first to comment

  • Be the first to like this

Query

  1. 1. Topic : Query<br /><ul><li>A search is when the computer looks for data meeting certain conditions. To do this, you use a query – which is basically a list of the things you want to the computer to look for.
  2. 2. Simple queries tell the database to look for records that meet just one condition.
  3. 3. SIMPLE QUERIESThis could be to list all the records of workers whose salary value equals $400 – the query is :Value = $400</li></ul>Below is the list of simple conditions of queries :<br />=Finds values equal to a certain amount.<Finds values less than the amount specified.>Finds values greater than the amount specified.<>Finds values not equal to the amount specified.<=Finds values less than or equal to the amount specified.>=Finds values greater than or equal to the amount specified.<br /><ul><li>You can also do wildcard searches. These are where you are only know part of the value to search for.Example : you may be remember that a worker’s last name begins with “Be” but cannot remember the full name.
  4. 4. WILDCARD SEARCHESUse * to stand for anything in the query.Last Name = “Be”,The asterisk can stand for anything (or nothing). So the results will include Best, Bentley and Beech, but not Batley or Boris.
  5. 5. You can also do complex searches – these are when you use AND, OR, and NOT (boolean logic )to find records that meet more than one conditon. They’re used in expressions which can only be either true or false.
  6. 6. COMPLEX SEARCHESThese search for data meeting more than one condition. You might need to find all the workers called either Boris or Beryl. So you seach criteria would be:First name = “Boris” OR “Beryl”Or may be you need to find worker called Boris who also have a salary value over $500. In this case the search is “First name = “Boris” AND value >$500Or may be you’re looking for people not called Boris whose salary value is not over $200. (you never know...)You could use:NOT(First name = “Boris”) And Value <=$200.

×