Data Manipulation Flashcards
Filtering
used to identify and isolate specific sets of data based on predefined criteria.
Condition
criterion or set of criteria that specify which data should be selected or manipulated within a database.
WHERE
conditional statement that is used to filter the results of a query
WHERE clause can be used in conjunction with SQL statements like SELECT, UPDATE,
DELETE, etc.
=, <, >, <>, >=, <=, BETWEEN, LIKE, IN, and NOT IN, and can also be used to combine multiple
conditions using AND / OR.
BETWEEN Operator:
selects values within a range
IN Operator:
IN operator allows you to specify multiple values in a WHERE clause. In PostgreSQL is used to reduce the need for
multiple OR conditions in a SELECT, UPDATE, INSERT, or DELETE statement.
NOT Operator:
The NOT IN operator displays a record if the exclusion condition is met
returns TRUE if the value is in the list of values matches, whereas the NOT IN operator returns TRUE if the value is not in the list of values or there is no match.
LIKE
LIKE is case-sensitive
ILIKE
ILIKE provides a case-insensitive option.
ORDER BY
ORDER BY clause is used in a SELECT statement to sort the results
in ascending (ASC ) or descending order (DESC) based on one or more columns.
LIMIT clause
used to limit the number of rows returned
OFFSET clause
used to skip a number of rows
CONCAT
to concatenate two or more strings into one
CONCAT_WS
specify a separator that will be inserted between the strings to concatenate
AS
to rename a column an alias
DISTINCT
allows to return only distinct (different) values within a column. I