SQL
SQL Use
Case sensitivity
SQL Commands Categories
SQL data types
CHAR(n)
fixed length n-character string
VARCHAR(n)
variable length character string with max. size of n characters
NUMERIC(x,y)
number with x digitis, y of which are after decimal point
Subqueries
Joining data from several datas - ways
Alias
Renaming
Views
Set operators
Absolute value of x
ABS(x)
Length of string s
LENGTH(s)
e.g. Return products with name that has 5 characters:
SELECT *
FROM Products
WHERE LENGTH(name) = 5;
Converts string s to lowercase & uppercase
LOWER(s)
UPPER(s)
Larger & smaller value of x and y
MAX(x,y)
MIN(x,y)
Produces a random number
RANDOM()
Number x rounded to d decimal places
ROUND(x,d)
Calculating a cumulative
SUM
Null returned
there is no value returned with the query (!= 0 -> if at any point of calculation / comparison NULL, the result will be NULL)