What is returned if you only specify a date you want to filter for from a column but the column is DATETIME type?
When you only specify a date when filtering a DATETIME column, time of midnight is assumed. So, if asked for ‘20070212’, only records on that date with a time stamp of midnight would be returned.
SQL Server 70-461 03-01
How does the NOT operator treat nulls?
Nulls will be excluded unless IS NULL, IS NOT NULL or some similar expression is used.
For example, NOT region=’WA’ will only return rows where the region is filled in and doesn’t equal WA. Since a null has an unknown value, the query cannot decide if it doesn’t equal WA and excludes it.
SQL Server 70-461 03-01
What is the proper form of a predicate using LIKE?
column LIKE pattern
SQL Server 70-461 03-01
How can you combine predicates in the WHERE clause?
SQL Server 70-461 03-01
Explain Three Valued Logic
Predicate can evaluate to true, false or unknown since NULLS are involved.
SQL Server 70-461 03-01
Explain Two-Valued Logic
Predicate expression evaluates to true or false, if NULLS are not possible.
SQL Server 70-461 03-01
How does the % wildcard work?
SQL Server 70-461 03-01
How does the _ wildcard work?
SQL Server 70-461 03-01
How does the character list wildcard work?
SQL Server 70-461 03-01
What form does a predicate need to be in for the query to filter efficiently?
A search argument
SQL Server 70-461 03-01
What does not work when trying to include NULLS in a WHERE clause?
SQL Server 70-461 03-01
What does it mean for a WHERE clause to evaluate to false?
The predicate evaluates to false and nulls are not included.
SQL Server 70-461 03-01
How does the character range wildcard work?
SQL Server 70-461 03-01
How does the NOT IN character list or range wild card work?
It works just like the character list and character range wildcards except you put a ^ after the left bracket to indicate not in the list or range.
SQL Server 70-461 03-01
What is a predicate?
An expression that is either true or false.
SQL Server 70-461 03-01
How can null values be included or excluded in a WHERE clause?
SQL Server 70-461 03-01
When combining predicates in a WHERE clause, what order of precedence holds?
Parenthesis actually trump all of these so if you use parenthesis you can make sure your statement is evaluated the way you want it to be.
SQL Server 70-461 03-01
What does it mean for a WHERE clause to evaluate to true?
The predicate expression is true and nulls are not included.
SQL Server 70-461 03-01
What does it mean for a WHERE clause to evaluate to true?
The predicate expression is true and nulls are not included.
SQL Server 70-461 03-01
How can you look for a character that is used as a wildcard?
SQL Server 70-461 03-01
When a string starts with a known prefix, why should you use LIKE to search for it?
Because LIKE ‘ABC%’ is considered a search argument. Using LEFT(col, 3)=’ABC’ is not considered a search argument and therefore wouldn’t be as efficient.
SQL Server 70-461 03-01
What three query clauses allow you to filter data based on predicates?
SQL Server 70-461 03-01
What are the types of wildcards to be used with LIKE?
SQL Server 70-461 03-01
What would be an example of filtering for a particular date using a search argument? What would not be a search argument?
Search Argument
- orderdate>=’20070201’ AND orderdate<’20070301’
Not a Search Argument
- YEAR(orderdate)=2007 AND MONTH(orderdate)=2
- This is not a search argument because functions are used on the column being searched.
SQL Server 70-461 03-01