SQL Interview Concepts
SQL Interview Concepts
1. SELECT Query
Example:
2. INSERT Query
Example:
INSERT INTO employees (name, age, department) VALUES ('John', 28, 'Sales');
3. UPDATE Query
Example:
4. DELETE Query
Example:
5. JOINs
Used to combine rows from two or more tables based on a related column.
Example:
GROUP BY groups rows with the same values; HAVING filters grouped rows.
Example:
SELECT department, COUNT(*) FROM employees GROUP BY department HAVING COUNT(*) > 5;
7. Subqueries
Example:
SELECT name FROM employees WHERE dept_id = (SELECT id FROM departments WHERE dept_name =
'IT');
8. Aggregate Functions
Functions like COUNT(), SUM(), AVG(), MIN(), MAX() for calculations on sets.
Example:
9. Indexes
Example:
10. Normalization
Process of organizing data to reduce redundancy. Key forms: 1NF, 2NF, 3NF.