7

Click here to load reader

Query

Embed Size (px)

Citation preview

Page 1: Query

QUERY

Creating a database

Page 2: Query

What is a QUERY?

Page 3: 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.

Page 4: Query

Simple Query

SIMPLE QUERIES

This could be to list all the records of workers whose salary value equals $400 – the query is :

Value = $400

Page 5: Query

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.

Page 6: Query

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.

Page 7: Query

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.