FFFF
FFFF
● LEFT JOIN: Returns all from the left table, plus matches from the
right.
-- Example (PostgreSQL)
1
6. What is the difference between GROUP BY and PARTITION
BY?
FROM orders
GROUP BY product
LIMIT 3;
FROM sales_data;
2
11. How can you identify trends over time?
FROM orders
GROUP BY month;
FROM sales_data;
3
16. How do you perform data cleaning in SQL?
SELECT
employee,
...
FROM sales_data
GROUP BY employee;
Using DENSE_RANK():
4
20. How do you debug a complex SQL query?
Use CTEs