ITEC48 (Sir Noel) Flashcards
is
used to fetch the data from a
database table which returns this
data in the form of a result table.
SQL SELECT statement
specifies the columns
to be displayed
SELECT Clause
specifies the table
containing the columns that are listed in
the SELECT Clause
FROM Clause
used to specify a condition
while fetching the data from a
single table or by joining with
multiple tables.
WHERE clause
can
perform arithmetical operations
on numeric operands involved.
Arithmetic operators
can also
be used in date arithmetic.
+ and - operators
are used to
override the default precedence
or to clarify the statement.
Parenthesis ()
Renames a column heading
Is useful with calculations
Immediately follows the column
name
Column Alias
are
used in conditions that
compare one expression to
another or expression.
Comparison Conditions
selects values within a given
range. The values can be
numbers, text, or dates.
The BETWEEN operator
is also known as the
membership condition.
IN condition
to test values in a specified
set of values
IN condition
is used in a
WHERE clause to search for a
specified pattern in a column.
LIKE operator
two wildcards often used
in conjunction with the LIKE
operator:
% and _
represents
zero, one, or multiple characters
%
represents a
single character
_
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.
logical condition
used to sort
the result-set in ascending or
descending order.
ORDER BY
sorts the
records in ascending order by default.
ORDER BY
used to add, delete or modify
columns in an existing table.
ALTER TABLE
used to remove a
table definition and all the data,
indexes, triggers, constraints and
permission specifications for that
table.
DROP TABLE
used to delete
complete data from an existing
TRUNCATE TABLE
used to return only distinct
eliminates
duplicate records from the results.
SELECT DISTINCT/DISTINCT
is a predefined
formula which takes one or more
arguments as input then process
the arguments and returns an
output.
function
are simply
sub-programs, which are
commonly used and re-used
throughout SQL database
applications for processing or
manipulating data.
SQL functions
returns a single value,
calculated from values in a
column.
AVG(), COUNT(), FIRST(),
LAST(), MAX(), MIN(), SUM()
Aggregate Function
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)
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
function calculates
the average of the values /
returns the average value of a
numeric column
AVG()
returns the number of rows in a
group or in matches a specified
criterion.
COUNT()