Manage data with Transact-SQL Flashcards

1
Q

The main language used to manage and manipulate data in Microsoft SQL Server and Azure SQL Database

A

Transact-SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

T-SQL has strong foundations in _.

A

mathematics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T-SQL is a dialect of _.

A

standard SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SQL is a standard of both the _ and the _.

A

International Organization for Standards (ISO),

American National Standards Institute (ANSI)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Writing SQL in a _ way is considered a best practice.

A

standard, standardized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

T/F: T-SQL enforces semicolons for all statements?

A

False, but is it considered a deprecated feature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Standard SQL is based on _, a mathematical model for data management and manipulation.

A

relational model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A mathematical model for data management and manipulation.

A

relational model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

T/F: The name “relational” has to do with relationships between tables.

A

False, it has to do with mathematical concept RELATION.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A relation in the relational model is what SQL tries to represent with a _.

A

table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In mathematical terms, a relation has a _ and a _.

A

heading,

body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

_ and _ are the relational model’s core foundations for which T-SQL uses for some of it’s most important aspects.

A

set theory,

predicate logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In the relational model, a _ is a set of attributes, which SQL attempts to represent with _.

A

heading,

columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In the relational model, a _ is a set of tuples, what SQL attempts to to represent with _.

A

body,

rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A set should be considered as a _, instead of interacting with the individual elements of the set.

A

whole

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

T/F: There is no relevance to the order of a set.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

T/F: There is no relevance to the order of a sequence.

A

False, a sequence is ordered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

T/F: A set has no duplicates.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A _ is an expression that when attributed to some object, make a proposition either _ or _.

A

predicate,
true,
false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

T-SQL is based more on _ than on set theory.

A

multiset theory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A multiset in many respects is similar to a set, but can have _.

A

duplicates

22
Q

SQL gives you the _ clause to remove duplicates.

A

DISTINCT

23
Q

If you need to guarantee a specific presentation order to the rows in the result, you need to add an _ clause to the query.

A

ORDER BY

24
Q

T/F: When adding an ORDER BY clause, the result is still relational.

A

False, it’s not relational because it’s ordered.

25
Q

T/F: When you issue a query with SELECT *, you are guaranteed to get the columns in the result based on definition order.

A

True

26
Q

T-SQL allows referring to _ positions of columns from the result in the ORDER BY clause.

A

ordinal

27
Q

According to the relational model, all attributes must have _.

A

names

28
Q

T/F:With T-SQL, a query can return multiple result columns in the same name.

A

true

29
Q

For the result to be relational, all attributes must have unique _.

A

names

30
Q

You need to carefully understand what happens when _ are involved in the data you’re manipulating with various query constructs like filtering, sorting, grouping , joining, or intersecting.

A

NULLs

31
Q

Fields and records are _.

A

physical

32
Q

A _ is a marker for a missing value, not a value itself.

A

NULL

33
Q

T-SQL has both _ and _ sides to it.

A

logical,

physical

34
Q

The main statement used to retrieve data in t-SQL is the _ statement.

A

SELECT

35
Q

The logical query processing order of the six main query clauses:

A
  1. FROM
  2. WHERE
  3. GROUP BY
  4. HAVING
  5. SELECT
  6. ORDER BY
36
Q

If a _ clause is specified, it isn’t relational. This means that you can’t operate on such a result with an outer query because an outer query expects a relation as input.

A

ORDER BY

37
Q

An outer query expects a _ as input.

A

relation

38
Q

All expressions processed after the _ must guarantee a single value per group.

A

GROUP BY clause

39
Q

A predicate can evaluate to true, false, or __.

A

unknown

40
Q

The __ clause is evaluated after the data has been grouped

A

HAVING

41
Q

The __ clause is evaluated before rows are grouped.

A

WHERE

42
Q

The __ clause is evaluated per row.

A

WHERE

43
Q

The __ clause is evaluated per group.

A

HAVING

44
Q

The query phases in order as you type them are:

A
  1. SELECT
  2. FROM
  3. WHERE
  4. GROUP BY
  5. HAVING
  6. ORDER BY
45
Q

The SELECT phase returns a __ result.

A

relational

46
Q

The DISTINCT gets applied during the __ phase.

A

SELECT

47
Q

Column alias are created during the __ phase.

A

SELECT

48
Q

__ are not visible to clauses processed in previous phases like FROM, WHERE, GROUP BY, and HAVING.

A

Column aliases

49
Q

An __ created by the SELECT phase isn’t even visible to the expressions that appear in the same SELECT list.

A

alias

50
Q

The __ clause is the first and only clause that is allowed to refer to column aliases defined in the SELECT clause.

A

ORDER BY