Skill 1.1 Create Transact-SQL SELECT queries Flashcards
Evaluate your level of knowledge for Skill 1.1 (Create Transact-SQL SELECT queries) for Microsoft Exam 70-761
What are the major revisions of the ANSI SQL Standard (as of July 2016)
SQL-86 SQL-89 SQL-92 SQL:1999 SQL:2003 SQL:2006 SQL:2008 SQL:2011 SQL:2016
What are the two main differences between the CAST and CONVERT functions in T-SQL?
CAST is an ANSI SQL standard function
CONVERT has a style argument for formatting text
What is a relation (in the relational model) in SQL?
A relation is what SQL calls a table
What are the two main parts of a relation, in the relational model?
Heading
Body
What is a heading, in the relational model?
A heading is a set of attributes, each of a given type (what SQL represents with columns)
How are attributes identified, in the relational model?
Attributes are identified by name (e.g. orderid) and type name (e.g. INT)
What makes up the body of a relation, in the relational model?
A set of tuples (pronounced like “couples”, what SQL represents with rows)
What is a tuple?
A name-value pair. In the body of a relation, each tuple’s heading is the heading of the relation. (Revision: The body of a relation is a set of tuples, each tuple consisting of a set of attributes which are the same as the attributes of the relation.)
What does the “not equal” operator in T-SQL look like?
There are two forms
<> (SQL standard)
!= (non-standard)
In SQL Server, do columns have to have names?
No, but a result set with an unnamed column is non-relational
In order from first to last, what are the phases of logical query processing?
FROM WHERE GROUP BY HAVING SELECT ORDER BY
In order from first to last, what is the order of the main SQL query clauses as keyed-in?
SELECT FROM WHERE GROUP BY HAVING ORDER BY
What is a column alias?
A column alias is an alternate name for a column or expression that is defined in the SELECT clause of a query
What phase of query processing can refer to column aliases?
ORDER BY (each phase can only refer to attributes that come in earlier phases of the logical query processing order)
The JOIN clause is part of which main phase?
FROM
What two forms of delimiters are supported in T-SQL?
Double-quotes ("Sales"." Orders", SQL standard) Square brackets([Sales].[Orders], non-standard)
What is three-valued logic?
Three-valued logic is TRUE, FALSE, and UNKNOWN
Two values that match (TRUE)
Two values that do not match (FALSE)
An attempt to match NULL with something (UNKNOWN)
What are combining predicates?
Keywords that allow for the modification or aggregation of matching expressions. NOT, AND, and OR are combining predicates.
What is the order of precedence for combining predicates?
NOT
AND
OR
When using the LIKE operator, what wildcard expression lets you match any string, including an empty string?
% (percent)
‘D%’ would match any string starting with “D”