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
are simply sub-programs, which are commonly used and re-used throughout SQL database applications for processing or manipulating data.
SQL functions
26
returns a single value, calculated from values in a column. AVG(), COUNT(), FIRST(), LAST(), MAX(), MIN(), SUM()
Aggregate Function
27
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()
SQL Scalar Function (Non-Aggregate Function)
28
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.
aggregate function
29
function calculates the average of the values / returns the average value of a numeric column
AVG()
30
returns the number of rows in a group or in matches a specified criterion.
COUNT()
31
returns the minimum value/smallest value in a set of values/selected columns..
MIN()
32
returns the maximum value/ largest value in a set of values/ selected columns.
MAX() function
33
is used to group rows returned by SELECT statement into a set of summary rows or groups based on values of columns or expressions.
GROUP BY
34
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.
HAVING clause
35
used to filter rows
WHERE CLAUSE
36
used to filter groups of rows.
HAVING CLAUSE
37
A functions that perform operations on character values.
MySQL String Function
38
Converts a string to upper-case
UCASE()
39
extracts a substring from a string (starting at any position).
MID()V
40
A functions that perform operations on numeric values.
MySQL Numeric Function
41
rounds a number to a specified number of decimal places.
ROUND()
42
A functions that perform operations on date values.
DATE FUNCTION
43
DATE FUNCTIONS
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
SQL Date Data Types
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
A functions for handling null values. Accepts two arguments and returns the first if its not NULL
IFNULL
46
combine the results of multiple sets into a single set are used to combine or subtract the records from two tables.
RELATIONAL SET OPERATORS
47
The resulting records will also have same number of columns and same datatypes for the respective column.
UNION COMPATIBLITY.
48
is used to combine the result-set of two or more SELECT statements. (only distinct values)
UNION operator
49
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.
INTERSECT operator
50
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.
MINUS operator
51
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.
EXCEPT operator
52
specifies how to relate tables in the query. is one of the set operations available in relational databases.
JOIN operator
53
is used to combine rows from two or more tables, based on a related column between them.
JOIN clause
54
returns records that have matching values in both tables.
INNER JOIN
55
returns all rows from both the participating tables which satisfy the join condition along with rows which do not satisfy the join condition.
SQL OUTER JOIN
56
is a query that contains the same or different join types, which are used more than once.
Multiple join
57
Goes through conditions and return a value when the first condition is met
CASE
58
Converts a value (of any type) into a specified datatype
CAST
59
Returns the first non-null value in a list
COALESCE
60
Converts a number from one numeric base system to another
CONV
61
Converts a value into the specified datatype or character set
CONVERT
62
Return a specified value if the expression is NULL, otherwise return the expression
IFNULL
63
Returns 1 or 0 depending on whether an expression is NULL
ISNULL
64
Returns the AUTO_INCREMENT id of the last row that has been inserted or updated in a table
LAST_INSERT_ID
65
Returns the current date and time
CURRENT_TIMESTAMP
66
Returns the current time
CURTIME
67
Extracts the date part from a datetime expression
DATE
68
Returns the number of days between two date values
DATEDIFF
69
Returns a date from a numeric datevalue
FROM_DAYS
70
Returns the current date and time
LOCALTIME LOCALTIMESTAMP
71
Returns the difference between two time/datetime expressions
TIMEDIFF
72
Returns the number of records returned by a select query
COUNT
73
Returns e raised to the power of a specified number
EXP
74
Returns the largest integer value that is <= to a number
FLOOR
75
Returns the natural logarithm of a number
LN
76