Murach's SQL server for developers 2022: Chapter 5 terms

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

1/7

flashcard set

Earn XP

Description and Tags

NOTE: These are not the exact definitions from the book!

Last updated 12:13 PM on 9/21/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

8 Terms

1
New cards

scalar functions

Functions that operate on a single value (or a set of single values from one row) and return a single value, such as LEN, UPPER, ROUND, and GETDATE. They are applied to each row individually. Example: SELECT UPPER(VendorName), LEN(VendorName) FROM Vendors;

2
New cards

aggregate function

A function that operates on a set of rows and returns a single summary value, such as SUM, AVG, MIN, MAX, and COUNT. Most ignore NULL values. Example: SELECT AVG(InvoiceTotal) FROM Invoices;

3
New cards

column function

Another term for an aggregate function: a function that performs a calculation on the values in a column across multiple rows. Example: SELECT MAX(InvoiceTotal) FROM Invoices;

4
New cards

summary query

A query that uses aggregate functions (often with GROUP BY and HAVING) to return summarized data, such as totals or averages, rather than individual detail rows. Example: SELECT VendorID, SUM(InvoiceTotal) AS TotalDue FROM Invoices GROUP BY VendorID HAVING SUM(InvoiceTotal) > 1000;

5
New cards

scalar aggregate

A summary query that uses aggregate functions without a GROUP BY clause, returning a single row that summarizes the entire result set. Example: SELECT COUNT(*) AS InvoiceCount, SUM(InvoiceTotal) AS GrandTotal FROM Invoices; (returns one row)

6
New cards

vector aggregate

A summary query that uses aggregate functions with a GROUP BY clause, returning one summary row for each group. Example: SELECT VendorID, COUNT(*) AS InvoiceCount FROM Invoices GROUP BY VendorID; (one row per vendor)

7
New cards

cumulative total

A running total that adds each row's value to the sum of all previous rows in an ordered set, calculated with an aggregate window function such as SUM() OVER (ORDER BY …). Example: SELECT InvoiceDate, InvoiceTotal, SUM(InvoiceTotal) OVER (ORDER BY InvoiceDate ROWS UNBOUNDED PRECEDING) AS RunningTotal FROM Invoices; (Specifying ROWS avoids the default RANGE frame, which gives tied dates the same total.)

8
New cards

moving average

An average calculated over a sliding window of rows (for example, the current row and the two before it), defined in an OVER clause with a frame such as ROWS BETWEEN 2 PRECEDING AND CURRENT ROW. Example: SELECT InvoiceDate, InvoiceTotal, AVG(InvoiceTotal) OVER (ORDER BY InvoiceDate ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS MovingAvg FROM Invoices; (The first two rows average fewer than three values.)