1/39
Vocabulary practice flashcards covering multi-table joins, aggregate functions, DML statements, subqueries, database views, and Transact-SQL programming.
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.
Minimum Join Conditions Rule
A guideline stating that to join n tables together, a query requires a minimum of (n−1) join conditions.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
HAVING Clause
A clause used alongside GROUP BY to filter and restrict groups based on aggregate conditions, applied after rows are grouped.
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.
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.
DELETE Statement
A SQL statement used to remove one or more complete rows from a table based on an optional WHERE condition.
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.
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.
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.
Single-Row Subquery
A subquery that returns exactly one row to the outer statement and works with single-row comparison operators such as =, >, >=, <, <=, or <>.
Multiple-Row Subquery
A subquery that returns more than one row of results and requires multiple-row operators such as IN, ANY, or ALL.
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).
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).
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.
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.
View
A virtual table whose contents are dynamically defined by a SELECT query referencing base tables, produced only when referenced by another query.
ALTER VIEW Statement
A Transact-SQL command used to modify the definition of an existing view without needing to drop and re-create it.
DROP VIEW Statement
A Transact-SQL command used to permanently remove an existing view object from the database.
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.
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.
GO
A batch-separator command used in SQL Server utilities to signal the termination and execution of a T-SQL batch.
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.
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.
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.
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.
BREAK
A keyword inside a WHILE loop that immediately terminates the innermost loop and jumps to the statement following the loop's END keyword.
CONTINUE
A keyword inside a WHILE loop that causes the loop to restart immediately, skipping any statements that follow it in that iteration.
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.
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.