Collection of SQL queries
- CASE WHEN.
- Self joins.
- DISTINCT and GROUP BY
- Left vs outer joins.
- UNION vs UNION ALL
- SUM and COUNT
- Date-time functions
- Casting and substring
- Window functions like rank and row
- Subqueries
- HAVING vs WHERE
- LAG and LEAD
- Understanding indexing
- Running totals
- MAX and MIN
- Using SUM CASE WHEN to count
- COUNT DISTINCT
- How to debug a query.
- How to speed up a query.
- Rank and dense rank
Prepare these topics well!!
📌 Basic SQL Commands - DDL, DML, DCL, DQL and TCL (SELECT, DELETE, UPDATE, TRUNCATE, DROP, CREATE, INSERT, REVOKE, GRANT, COMMIT, ROLLBACK, SAVEPOINT) 📌 Aggregation Functions - SUM, MIN, MAX, AVG, PRODUCT, DIFFERENCE. 📌 GROUP BY, PARTITION BY, WITH. 📌 Common Table Expressions (CTE) 📌 Joins (Don't ignore 📌 Window Functions (RANK, DENSE_RANK, ROW_NUMBER, LEAD, LAG) 📌 Date Time Functions 📌 String Functions 📌 CASE WHEN, SWITCH 📌 Null Functions 📌 Logical Functions 📌 WHERE, HAVING, ORDER BY, LIMIT, OFFSET, FETCH. 📌 UNION and UNION ALL. 📌 Theoritical knowledge on Views, Stored Procedures, Functions (Good to have)
