SQL - Functions Flashcards

1
Q

Aggregate functions: What does AVG(column_name) do?

A

Returns the average value of a column.

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

Aggregate functions: What does COUNT(column_name) do?

A

Returns the number of rows (without a NULL value) of a column.

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

Aggregate functions: What does COUNT(*) do?

A

Returns the number of selected rows.

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

Aggregate functions: What does FIRST(column_name) do?

A

Returns the value of the first record in a specified field.

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

Aggregate functions: What does LAST(column_name) do?

A

Returns the value of the last record in a specified field.

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

Aggregate functions: What does MAX(column_name) do?

A

Returns the highest value of a column.

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

Aggregate functions: What does MIN(column_name) do?

A

Returns the lowest value of a column.

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

Aggregate functions: What does SUM(column_name) do?

A

Returns the total sum of a column.

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

Aggregate functions: What does FIRST(column_name) do?

not supported in SQLServer2K

A

Returns the value of the first record in a specified field.

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

Aggregate functions: What does LAST(column_name) do?

not supported in SQLServer2K

A

Returns the value of the last record in a specified field.

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

Scalar functions: What does UCASE(c) do?

A

Converts a field to upper case.

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

Scalar functions: What does LCASE(c) do?

A

Converts a field to lower case.

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

Scalar functions: What does MID(c,start[,end]) do?

A

Extract characters from a text field.

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

Scalar functions: What does LEN(c) do?

A

Returns the length of a text field.

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

Scalar functions: What does INSTR(c,char) do?

A

Returns the numeric position of a named character within a text field.

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

Scalar functions: What does LEFT(c,number_of_char) do?

A

Return the left part of a text field requested.

17
Q

Scalar functions: What does RIGHT(c,number_of_char) do?

A

Return the right part of a text field requested.

18
Q

Scalar functions: What does ROUND(c,decimals) do?

A

Rounds a numeric field to the number of decimals specified.

19
Q

Scalar functions: What does MOD(x,y) do?

A

Returns the remainder of a division operation.

20
Q

Scalar functions: What does NOW() do?

A

Returns the current system date.

21
Q

Scalar functions: What does FORMAT(c,format) do?

A

Changes the way a field is displayed.

22
Q

Scalar functions: What does DATEDIFF(d,date1,date2) do?

A

Used to perform date calculations.