ITEC48 (Sir Noel) Flashcards

1
Q

is
used to fetch the data from a
database table which returns this
data in the form of a result table.

A

SQL SELECT statement

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

specifies the columns
to be displayed

A

SELECT Clause

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

specifies the table
containing the columns that are listed in
the SELECT Clause

A

FROM Clause

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

used to specify a condition
while fetching the data from a
single table or by joining with
multiple tables.

A

WHERE clause

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

can
perform arithmetical operations
on numeric operands involved.

A

Arithmetic operators

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

can also
be used in date arithmetic.

A

+ and - operators

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

are used to
override the default precedence
or to clarify the statement.

A

Parenthesis ()

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

Renames a column heading

Is useful with calculations

Immediately follows the column
name

A

Column Alias

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

are
used in conditions that
compare one expression to
another or expression.

A

Comparison Conditions

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

selects values within a given
range. The values can be
numbers, text, or dates.

A

The BETWEEN operator

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

is also known as the
membership condition.

A

IN condition

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

to test values in a specified
set of values

A

IN condition

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

is used in a
WHERE clause to search for a
specified pattern in a column.

A

LIKE operator

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

two wildcards often used
in conjunction with the LIKE
operator:

A

% and _

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

represents
zero, one, or multiple characters

A

%

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

represents a
single character

A

_

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

combines the
result of two component conditions
to produce a single result based on
those conditions, or it inverts the
result of a single condition.

A

logical condition

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

used to sort
the result-set in ascending or
descending order.

A

ORDER BY

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

sorts the
records in ascending order by default.

A

ORDER BY

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

used to add, delete or modify
columns in an existing table.

A

ALTER TABLE

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

used to remove a
table definition and all the data,
indexes, triggers, constraints and
permission specifications for that
table.

A

DROP TABLE

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

used to delete
complete data from an existing

A

TRUNCATE TABLE

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

used to return only distinct

eliminates
duplicate records from the results.

A

SELECT DISTINCT/DISTINCT

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

is a predefined
formula which takes one or more
arguments as input then process
the arguments and returns an
output.

A

function

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

are simply
sub-programs, which are
commonly used and re-used
throughout SQL database
applications for processing or
manipulating data.

A

SQL functions

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

returns a single value,
calculated from values in a
column.

AVG(), COUNT(), FIRST(),
LAST(), MAX(), MIN(), SUM()

A

Aggregate Function

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

returns a single value, based on the
input value.

It also allows you to perform different
calculations on data values.

UCASE(), LCASE(), MID(), LEN(),
ROUND(), NOW(), FORMAT()

A

SQL Scalar Function
(Non-Aggregate Function)

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

a function
where the values of multiple rows
are grouped together as input on
certain criteria to form a single
value of more significant meaning.

allows
you to perform a calculation on
a set of values to return a single
scalar value.

A

aggregate function

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

function calculates
the average of the values /
returns the average value of a
numeric column

A

AVG()

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

returns the number of rows in a
group or in matches a specified
criterion.

A

COUNT()

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

returns the
minimum value/smallest value
in a set of values/selected
columns..

A

MIN()

32
Q

returns
the maximum value/ largest
value in a set of values/ selected
columns.

A

MAX() function

33
Q

is used
to group rows returned by
SELECT statement into a set of
summary rows or groups based on
values of columns or expressions.

A

GROUP BY

34
Q

is often used
with the GROUP BY clause in the
SELECT statement to filter group of
rows based on a specified condition.

works like the
WHERE clause if it is not used with the
GROUP BY clause.

A

HAVING clause

35
Q

used to filter
rows

A

WHERE CLAUSE

36
Q

used to
filter groups of rows.

A

HAVING CLAUSE

37
Q

A functions that perform
operations on character values.

A

MySQL String Function

38
Q

Converts a string to upper-case

A

UCASE()

39
Q

extracts a
substring from a string (starting
at any position).

A

MID()V

40
Q

A functions that perform
operations on numeric values.

A

MySQL Numeric Function

41
Q

rounds a
number to a specified number of
decimal places.

A

ROUND()

42
Q

A functions that perform
operations on date values.

A

DATE FUNCTION

43
Q

DATE FUNCTIONS

A

NOW()- Returns the current date and time

CURDATE()- Returns the current date

CURTIME()- Returns the current time

DATE()- Extracts the date part of a date or date/time
expression

EXTRACT()- Returns a single part of a date/time

DATE_ADD()- Adds a specified time interval to a date

DATE_SUB()- Subtracts a specified time interval from a date

DATEDIFF()- Returns the number of days between two dates

DATE_FORMAT()- Displays date/time data in different formats

44
Q

SQL Date Data Types

A

DATE - format YYYY-MM-DD

DATETIME - format: YYYY-MM-DD HH:MI:SS

TIMESTAMP - format: YYYY-MM-DD
HH:MI:SS

YEAR - format YYYY or YY

45
Q

A functions for handling null
values.

Accepts two arguments and returns the first if its not NULL

A

IFNULL

46
Q

combine
the results of multiple sets into a
single set

are
used to combine or subtract the
records from two tables.

A

RELATIONAL SET OPERATORS

47
Q

The resulting
records will also have same
number of columns and same
datatypes for the respective
column.

A

UNION
COMPATIBLITY.

48
Q

is used
to combine the result-set of two
or more SELECT statements.
(only distinct values)

A

UNION operator

49
Q

is
used to combine two SELECT
statements, but returns rows only from
the first SELECT statement that are
identical to a row in the second
SELECT statement.

returns only common rows
returned by the two SELECT
statements.

A

INTERSECT operator

50
Q

used to subtract
the result set obtained by first SELECT
query from the result set obtained by
second SELECT query.

will return only
those rows which are unique in only
first SELECT query and not those
rows which are common to both first
and second SELECT queries.

A

MINUS operator

51
Q

operator is
used to combine two SELECT
statements and returns rows from
the first SELECT statement that are
not returned by the second
SELECT statement.

returns
only rows, which are not
available in the second SELECT
statement.

A

EXCEPT operator

52
Q

specifies how
to relate tables in the query.
is one of the set
operations available in relational
databases.

A

JOIN operator

53
Q

is used to
combine rows from two or
more tables, based on a related
column between them.

A

JOIN clause

54
Q

returns
records that have matching
values in both tables.

A

INNER JOIN

55
Q

returns
all rows from both the
participating tables which satisfy
the join condition along with rows
which do not satisfy the join
condition.

A

SQL OUTER JOIN

56
Q

is a query that
contains the same or different
join types, which are used more
than once.

A

Multiple join

57
Q

Goes through conditions and return a value when the
first condition is met

A

CASE

58
Q

Converts a value (of any type) into a specified
datatype

A

CAST

59
Q

Returns the first non-null value in a list

A

COALESCE

60
Q

Converts a number from one numeric base system to
another

A

CONV

61
Q

Converts a value into the specified datatype or
character set

A

CONVERT

62
Q

Return a specified value if the expression is NULL,

otherwise return the expression

A

IFNULL

63
Q

Returns 1 or 0 depending on whether an expression is

NULL

A

ISNULL

64
Q

Returns the AUTO_INCREMENT id of the last row that has
been inserted or updated in a table

A

LAST_INSERT_ID

65
Q

Returns the current date and time

A

CURRENT_TIMESTAMP

66
Q

Returns the current time

A

CURTIME

67
Q

Extracts the date part from a datetime expression

A

DATE

68
Q

Returns the number of days between two date values

A

DATEDIFF

69
Q

Returns a date from a numeric datevalue

A

FROM_DAYS

70
Q

Returns the current date and time

A

LOCALTIME
LOCALTIMESTAMP

71
Q

Returns the difference between two time/datetime

expressions

A

TIMEDIFF

72
Q

Returns the number of records returned by a select

query

A

COUNT

73
Q

Returns e raised to the power of a specified number

A

EXP

74
Q

Returns the largest integer value that is <= to a number

A

FLOOR

75
Q

Returns the natural logarithm of a number

A

LN

76
Q
A