Chapter 4: Accessing Marketing Data Using Structured Query Language Flashcards

1
Q

What are the two biggest language categories of SQL?

A

Table functions and query functions

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

SELECT

A

Gathers specific data from a table

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

FROM

A

Establishes which table the data is gathered from
■ SELECT CustomerID
■ FROM CustomerDemo

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

WHERE

A

Defines a specific condition desired in the outcome
■ SELECT CustomerID, CustomerName
● FROM CustomerDemo
● WHERE Age = 35

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

GROUP BY

A

GROUP BY
○ This function tells SQL how to segment the data that is selected.
SELECT OrderNumber
FROM OrderInfo
GROUP BY State

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

JOIN

A

OIN
* Combines two tables of
data
* The command “ON”
labels which two tables
to be joined

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

4 Variations of SQL Joins?

A

Inner Join
Left Join
Right Join
Full Join

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

Which answer most precisely reflects the expected
number of records from an INNER join of these
two tables? ● Left Table: university registrar from current term – 20,000 records
● Right Table: university email list – 100,000 records
A. ≤ 100,000
B. ≥100,000
C. Exactly 100,000
D. ≤ 20,000
E. ≥ 20,000
F. Exactly 20,000

A

D

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

Which answer most precisely reflects the expected
number of records from a LEFT join of these two
tables?
● Left Table: university registrar from current term – 20,000
records
● Right Table: university email list – 100,000 records
A. ≤ 100,000
B. ≥100,000
C. Exactly 100,000
D. ≤ 20,000
E. ≥ 20,000
F. Exactly 20,000

A

F

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

Which answer most precisely reflects the expected
number of records from a RIGHT join of these two tables?
● Left Table: university registrar from current term – 20,000
records
● Right Table: university email list – 100,000 records
A. ≤ 100,000
B. ≥100,000
C. Exactly 100,000
D. ≤ 20,000
E. ≥ 20,000
F. Exactly 20,000

A

C

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

Which answer most precisely reflects the expected
number of records from a FULL join of these two
tables?
● Left Table: university registrar from current term – 20,000
records
● Right Table: university email list – 100,000 records
A. ≤ 100,000
B. ≥ 100,000
C. Exactly 100,000
D. ≤ 20,000
E. ≥ 20,000
F. Exactly 20,000

A

B

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

COUNT()

A

Reveals the number of rows (respondents/products/etc.) that fit the stated
criteria
* Example: In a relational database of a company’s customers, one could find
the number of female customers aged 25-34 who purchased an item last week

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

Summary Query Commands

A

Summary queries are SQL commands that can answer simple statistical questions of the data

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

AVG()

A

Generates the average value of a numeric column
* Example: One can determine the average age of all customers

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

SUM()

A

Generates the sum of a numeric column
* Example: One can retrieve the summation of sales made in a certain year

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

MAX() & MIN()

A

Generates the largest/smallest value that fits a specified criteria
* Example: One can determine the customer who made the smallest or biggest purchase last week

17
Q

BETWEEN()

A

Displays Data between a specific range of values
* Example: One can select the customers between the ages of 18-25

18
Q

AND

A

Displays data that is a combination of two conditions
* Example: One can display the customers between the ages of 18-25 and live in California.

19
Q

WHERE

A

A WHERE clause is
used is filter records
from a result. The
filter occurs before
any groupings are
made

20
Q

HAVING

A

A HAVING clause is
used to filter values
from a group.