Section 3 Flashcards

1
Q

The BETWEEN operator

A

Provides an alternative way to determine if a value is between two other values

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

The LIKE operator

A

When used in a WHERE clause, matches text against a pattern using the two wildcard characters % and _

% matches any number of characters. Ex: LIKE ‘L%t’ matches “Lt”, “Lot”, and “ Lol cat”.
_ matches exactly one character. Ex: LIKE ‘L_t’ matches “Lot”, and “Lit” but not “Lt” and “Loot”

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

The ORDER BY clause

A

Orders selected rows by one or more columns in ascending( alphabetic or increasing) order.

The DESC keyword with the ORDER BY clause orders rows in descending order.

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

Function: ABS(n)
Description: ?
Ex: ?

A

Description: Returns the absolute value of n

Ex: SELECT ABS(-5);

returns 5

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

Function: LOWER(s)
Description: ?
Ex: ?

A

Description: Returns the lowercase
Ex: SELECT LOWER(‘MySQL’);
returns ‘mysql’

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

Function: TRIM(s)
Description: ?
Ex: ?

A

Description: Returns the string s without leading and trailing spaces
Ex: SELECT TRIM(‘ test ‘);

returns ‘test’

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

Function:
HOUR(t)
MINUTE(t)
SECOND(t)
Description:?
Ex:?

A

Description: Returns the hour, minute or second from time t

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

An aggregate function

A

Processes values from a set of rows and returns a summary value.

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

Common aggregate functions are:

A

-COUNT() counts the number of rows in the set
-MIN() finds the minimum value in the set
-MAX() finds the maximum value in the set
-SUM() sums all the values in the set
-AVG() computes the arithmetic mean of all the values in the set.

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

The HAVING clause

A

Is used with the GROUP BY clause to filter group results

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

A join is

A

A SELECT statement that combines data from two tables, known as the left table and right table, into a single result.
The tables are combined by comparing columns from the left and right tables, usually with the = operator

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

Inner join

A

Selects only only matching left and right table rows

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

Full join

A

Selects all left and right table rows, regardless of match

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

Left join

A

Selects all left table rows, but only matching right table rows

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

Right join

A

Selects all right table rows, but only matching left table rows.

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

An Outer join

A

Is any join that selects unmatched rows, including left, right and full joins

17
Q

The UNION keyword

A

Combines the two results into one table

18
Q

An equijoin

A

Compares columns of two tables with the = operator. Most joins are equijoins.

19
Q

A non-equijoin

A

Compares columns with an operator other than =, such as < and >.

20
Q

A self-join

A

Joins a table to itself

21
Q

A cross-join

A

Combines two tables without comparing columns. A —– uses a —– clause without an ON clause

22
Q

A subquery

A

Sometimes called a nested query or inner query, is a query within another SQL query.

23
Q

An alias

A

Is a temporary name assigned to a column or table.
The AS keyword follows a column or table name to create an —-

24
Q

A materialized view

A

Is a view for which data is stored at all times. Whenever a base table changes, the corresponding view tables can also change, so —– must be refreshed.

25
Q

When WITH CHECK OPTION is specified

A

The database rejects inserts, and updates that do not satisfy the view query WHERE clause.