March 2001
Intermediate to advanced
640 pages
14h 9m
English
| 1: | Can you use wildcards with IN, as in this example?
select ProductName, UnitPrice
from Products
where ProductName in ('%tofu%', '%cereal%', '%grain%') |
| A1: | No. The server will treat the wildcards (% characters) as literal characters and will try to find products whose name is literally '%tofu%' or '%cereal%'. To combine multiple wildcard searches, use OR to connect LIKE clauses:
select ProductName, UnitPrice
from Products
where ProductName like '%tofu%'
or ProductName like '%cereal%'
or ProductName like '%grain%' |
| 2: | When do you need to group conditions using parentheses? |
| A2: | Parentheses are required when your WHERE clause consists of more than two conditions and there is a combination of OR and AND conjunctions. |
| 3: | In this query, is the ... |
Read now
Unlock full access