This repository contains a single consolidated SQL file covering all major SQL concepts, assignments, and interview-style questions.
It includes queries, triggers, joins, views, procedures, and TCL operations, all written and executed in MySQL.
- SELECT, WHERE, DISTINCT
- ORDER BY, LIMIT
- IN, BETWEEN, NOT BETWEEN
- IS NULL / IS NOT NULL
- UPPER(), LOWER()
- SUBSTRING()
- CONCAT()
- NOW(), YEAR(), DATEDIFF()
- Calculating employee tenure
- PRIMARY KEY, FOREIGN KEY
- UNIQUE constraints
- ALTER TABLE operations
- COUNT(), SUM(), AVG(), MAX(), MIN()
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- Multi-table joins
- Simple view
- Complex view joining Employees, Departments, Salaries
- Parameterized procedure to fetch employee details
- AFTER DELETE trigger to log deleted Orders
- Using OLD values
- START TRANSACTION
- SAVEPOINT
- COMMIT
- ROLLBACK
- Bank transaction scenario
file.
-
Open the SQL file in MySQL Workbench or any SQL editor.
-
Run each section to practice concepts or prepare for interviews.
This repository demonstrates practical understanding of SQL including:
- Real-world scenarios
- Database operations
- Backend logic (procedures, triggers)
- Data integrity (TCL, constraints)
Useful for:
- Data Analyst roles
- Software Developer roles
- SQL interview preparation
- Portfolio building
- Recruiter evaluation
Feel free to connect with me on LinkedIn or GitHub for any collaboration.