Database Administration: Lessons 7–12 Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering multi-table joins, aggregate functions, DML statements, subqueries, database views, and Transact-SQL programming.

40 Terms

1
New cards

Join

An operation that merges rows from one data set with rows from another data set according to common values existing in corresponding columns (usually primary and foreign key columns), producing a new set of rows containing columns from both.

2
New cards

Minimum Join Conditions Rule

A guideline stating that to join nn tables together, a query requires a minimum of (n−1)(n - 1) join conditions.

3
New cards

Inner Join

A join (also called an equijoin) that includes only those rows from each side of the join that are contained within the intersection of the two data sources, returning only rows with matching values in the join column.

4
New cards

Table Alias

An alternate name given to a table in the FROM clause that keeps SQL statements smaller, reduces memory usage, and eliminates ambiguity when referencing columns from multiple tables.

5
New cards

Left Outer Join

A join that returns all rows from the left-hand table specified in the ON condition, but only those rows from the right-hand table where the join fields are equal; unmatched right-hand table fields display as NULL.

6
New cards

Right Outer Join

A join that returns all rows from the right-hand table specified in the ON condition, and only those rows from the left-hand table where the joined fields are equal; unmatched left-hand table fields display as NULL.

7
New cards

Full Outer Join

A join that returns all rows from both the left-hand and right-hand tables, placing NULL in columns where the join condition is not met.

8
New cards

Self Join

A join in which a table is joined with itself (representing a unary relationship), typically executed using table aliases when a table contains a foreign key referencing its own primary key.

9
New cards

Aggregate Functions

Functions that perform a calculation on one or more values in a column and return a single summary value (e.g., SUM, AVG, MIN, MAX, and COUNT).

10
New cards

COUNT(*)

A variation of the COUNT function that returns the total number of rows in a table, including duplicate rows and rows containing NULL values in any column.

11
New cards

COUNT(expr)

A variation of the COUNT function that returns the count of non-null rows specifically found in the column identified by the expression.

12
New cards

ISNULL Function

A function that replaces NULL with a designated value (e.g., replacing NULL with 0), forcing group aggregate functions to include rows that would otherwise be ignored.

13
New cards

GROUP BY Clause

A clause used with the SELECT statement to organize similar data into groups by combining multiple records across specified columns using aggregate functions.

14
New cards

HAVING Clause

A clause used alongside GROUP BY to filter and restrict groups based on aggregate conditions, applied after rows are grouped.

15
New cards

INSERT Statement

A SQL statement used to add one or more new records into a table, providing values for all NOT NULL columns without default or identity values.

16
New cards

UPDATE Statement

A SQL statement used to modify existing column values in a table, applying changes to rows matching the WHERE clause or to all rows if the WHERE clause is omitted.

17
New cards

DELETE Statement

A SQL statement used to remove one or more complete rows from a table based on an optional WHERE condition.

18
New cards

Subquery

A SELECT query (also called a nested query or subselect) embedded within clauses like WHERE, HAVING, or FROM in another SQL query, returning data used by the outer query.

19
New cards

Noncorrelated Subquery

An independent subquery that can stand alone, executes once before the outer query runs, and passes its resulting value or set back to the outer query.

20
New cards

Correlated Subquery

A subquery that references one or more columns from the outer query, causing the inner query to re-execute once for each row processed by the outer query.

21
New cards

Single-Row Subquery

A subquery that returns exactly one row to the outer statement and works with single-row comparison operators such as ==, >>, >=>=, <<, <=<=, or <><>.

22
New cards

Multiple-Row Subquery

A subquery that returns more than one row of results and requires multiple-row operators such as IN, ANY, or ALL.

23
New cards

ANY Operator

A multiple-row comparison operator that evaluates whether a value matches any value returned by the subquery (e.g., < ANY means less than the maximum, > ANY means more than the minimum, and = ANY is equivalent to IN).

24
New cards

ALL Operator

A multiple-row operator that evaluates whether a comparison holds true against every value returned by the subquery (e.g., < ALL means less than the minimum and > ALL means more than the maximum).

25
New cards

Derived Table

A subquery nested within the FROM or JOIN clause that behaves as a temporary virtual table in memory, requiring parentheses and a mandatory alias.

26
New cards

EXISTS Operator

A subquery operator that tests whether an inner query returns any rows, evaluating strictly to TRUE or FALSE rather than returning row data.

27
New cards

View

A virtual table whose contents are dynamically defined by a SELECT query referencing base tables, produced only when referenced by another query.

28
New cards

ALTER VIEW Statement

A Transact-SQL command used to modify the definition of an existing view without needing to drop and re-create it.

29
New cards

DROP VIEW Statement

A Transact-SQL command used to permanently remove an existing view object from the database.

30
New cards

Transact-SQL (T-SQL)

The procedural extension for SQL Server that includes commands to manage database objects, administer the server, and insert, retrieve, modify, and delete data.

31
New cards

Batch

A collection of one or more T-SQL statements submitted and executed by SQL Server as an independent unit, where an error in one batch causes it to be rejected without stopping separate batches.

32
New cards

GO

A batch-separator command used in SQL Server utilities to signal the termination and execution of a T-SQL batch.

33
New cards

Local Variable

A user-defined variable preceded by an @ symbol (up to 30 characters in length) that stores a single value in memory during batch execution and initializes to NULL.

34
New cards

Global Variable

A system-maintained variable preceded by @@ symbols that is reserved for use by SQL Server and cannot be declared or assigned values by the user.

35
New cards

BEGIN and END Keywords

Keywords used to group multiple Transact-SQL statements into a single executable statement block within control structures like IF…ELSE or WHILE.

36
New cards

WHILE Statement

A control-of-flow statement that repeatedly executes an SQL statement or statement block as long as its designated Boolean condition remains TRUE.

37
New cards

BREAK

A keyword inside a WHILE loop that immediately terminates the innermost loop and jumps to the statement following the loop's END keyword.

38
New cards

CONTINUE

A keyword inside a WHILE loop that causes the loop to restart immediately, skipping any statements that follow it in that iteration.

39
New cards

Simple CASE

A CASE expression format that compares a single input expression against a series of simple values using WHEN value THEN result clauses to return a matching outcome.

40
New cards

Searched CASE

A CASE expression format that evaluates a series of distinct Boolean expressions sequentially using WHEN condition THEN result until one evaluates to TRUE.