Click here to load reader
Upload
fizahphd
View
303
Download
5
Embed Size (px)
Citation preview
QUERY
Creating a database
What is a QUERY?
What is a QUERY?
Refer to as searching / interrogating a database.
Involves extracting information from the database.
Eg : Request of a database to list the details of all personnel over a certain age.
Simple Query
SIMPLE QUERIES
This could be to list all the records of workers whose salary value equals $400 – the query is :
Value = $400
Simple Query
= 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.
Wildcard searches
WILDCARD SEARCHES
Use * 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.
Complex searchesCOMPLEX SEARCHES
These 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 >$500
Or 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.