Chapter 05 slides

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/17

flashcard set

Earn XP

Description and Tags

Quiz

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards

The six clauses of a SELECT statement must be coded in which order?

SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY

2
New cards

Expressions coded in the WHERE clause____

can use non-aggregate search conditions but can’t use aggregate search conditions

3
New cards

Which of the statements below best describes the result set returned by this SELECT statement?

SELECT VendorID, SUM(InvoiceTotal - PaymentTotal - CreditTotal) AS Column2

FROM Invoices

WHERE InvoiceTotal - PaymentTotal - CreditTotal > 0

GROUP BY VendorID;

the total unpaid balance due for each VendorID

4
New cards

When coding a query with two columns in the GROUP BY clause, you can insert a summary row for each major group by coding which operator?

ROLLUP

5
New cards

Expressions coded in the HAVING clause____

can use either aggregate search conditions or non-aggregate search conditions

6
New cards

Which aggregate expression finds the VendorName column that’s last in alphabetical order?

MAX(VendorName)

7
New cards

Which of the statements below best describes the result set returned by this SELECT statement?

SELECT VendorState, COUNT(*) AS Column2

FROM Vendors

GROUP BY VendorState

HAVING COUNT(*) > 1;

the number of vendors in each state having more than one vendor

8
New cards

By default, all duplicate values are included in an aggregation calculation unless you specify which keyword?

DISTINCT

9
New cards

A search condition in the _____ clause is applied before the rows are grouped while a search condition in the ______ clause isn’t applied until after the grouping.

WHERE, HAVING

10
New cards

Which aggregate expression gets the number of unique values in the VendorID column?

COUNT(DISTINCT VendorID)

11
New cards

Scalar function

operate on a single value and return a single value

12
New cards

Aggregate function

operate on a series of values and returns a single summary value

13
New cards

column function

AKA aggregate function

14
New cards

summary query

a query that contains one or more aggregate functions

15
New cards

scalar aggregate

aggregate function that return a single value for all the rows in a result set

16
New cards

vector aggregate

aggregate function that returns a set of values for each group of rows in a result

17
New cards

cumulative total

an aggregate function that calculates the running total of a set of values over a specified range or period.

18
New cards

moving average

a calculation that analyzes data points by creating averages of different subsets of the complete data set over time.