1. Querying Data
SELECT
SELECT DISTINCT
CONCAT
Column aliases
2. Sorting data
ORDER BY
NULLS FIRST
NULLS LAST
ASC
DESC
3. Filtering data
WHERE
IN
BETWEEN
LIKE
ILIKE
IS NULL
LIMIT vs FETCH
Comparison operators(<, >, <=, >=, <>, !=, =)
Logical operators(AND, OR & NOT)
4. Joining Data
Why we need join ?
Table aliases
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL OUTER JOIN
SELF JOIN
CROSS JOIN
NATURAL JOIN
5. Grouping Data
GROUP BY
HAVING
6. Set Operations
UNION vs UNION ALL
EXCEPT
INTERSECT
7. Subquery
What is a Subquery ?
Correlated Subquery
ANY vs ALL
EXISTS
8. Common Table Expressions (CTEs)
9. Modifying Data
INSERT
UPDATE
DELETE
UPSERT
10. Transactions
BEGIN
ROLLBACK
COMMIT
11. Data Types in PostgreSQL
BOOLEAN
CHAR, VARCHAR & TEXT
NUMERIC
SMALLINT, INT & BIGINT
DATE, TIME, TIMESTAMP, TIMESTAMPZ & INTERVAL
UUID, ARRAY, HSTORE & JSON
12. PostgreSQL Constraints
PRIMARY KEY
FOREIGN KEY
CHECK constraint
NOT NULL constraint
UNIQUE constraint
13. Managing Tables
CREATE TABLE
CREATE AS vs SELECT INTO
RENAME TABLE
RENAME COLUMN
ADD COLUMN
DROP COLUMN
DROP TABLE
TEMPORARY TABLE
TRUNCATE TABLE
14. Conditional Expressions & Operators
CASE
COALESCE
NULLIF
CAST
15. PostgreSQL Functions
Aggregate Functions
Window Functions
Date Functions
String Functions
Math Functions
16. PostgreSQL Views
CREATE VIEW
ALTER VIEW
DROP VIEW
17. PostgreSQL Indexes
CREATE INDEX
INDEX on Expressions
UNIQUE Index
Partial Indexes
Multicolumn Indexes
DROP INDEX
18. SQL Interview Questions