



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




statements together.
entire thing if multiple clauses.
with wildcards (
or
-^
SQL’s response to case varies by database so in lookingfor all of the people who start with ‘SM’ we could (
Access
*uses , ANSI SQL %
):
...Where ( (LastName Like ‘SM’) or (Name Like ‘sm’) or (Name
Like ‘Sm*’) )
-^
If you know your database is case insensitive, you cansimplify your queries considerably:
…Where (LastName Like 'SM%')
-^
Notice to be safe we use ( ) around clauses. Wild cards canbe in front, back or both.
-^
Like clauses where the wild card is at the end are fasterthen mixed or at the beginning of the field to be searched.
subset of the records to be examined.
YearBorn In (1962, 1963, 1964)
HoleInOne
table and we wanted a list of all
authors born in years that had a hold in onewe could:
Select Name, YearBorn From Authors Where
YearBorn In (Select Year From HoleInOne)
-^
Notice we only return the ONE field in the subquery corresponding to the field in the Whereclause.
Day 2: Joins