Source of Information
Some notes here were taken while studying the first lessons of "SQL Fundamentals" from <datacamp.com>
Others were taken by demand.
SELECT with Regular Expressions
NOTE: I only tested this on MySQL.
SELECT column_list FROM table_name WHERE string_column REGEXP pattern;
SELECT productname FROM products WHERE productname REGEXP '^(A|B|C)' ORDER BY productname;
uniq in shell scripts.
Counts the number of rows.
Counts the number of no-null values in
Counts the number of distinct values in
WHERE a BETWEEN x AND y
Checks if the value of
a is between the values
WHERE a IN (value1, value2, value3)
a is equal one of the values in the list.
SELECT a LIKE pattern / SELECT a NOT LIKE pattern
Allows using patterns for searching.
% is a wildcard fro "anything", and
_ is a wildcard forr any character).