SQL vs NoSQL Databases: Quick Comparison โ
SQL Databases
- Structured data
- Fixed schema
- Table-based storage
- Strong consistency
- Popular tools: MySQL, PostgreSQL, SQL Server, Oracle
- Best use cases: Banking systems, ERP and CRM, transaction-heavy apps, reporting and analytics
- Job roles: Data Analyst, Backend Developer, Database Engineer, BI Developer
- Hiring reality: Mandatory in enterprises, core skill for analytics roles, used in almost every company
- India salary range: Fresher (4-7 LPA), Mid-level (8-18 LPA)
- Real tasks: Write complex queries, join multiple tables, build reports, ensure data integrity
NoSQL Databases
- Semi-structured or unstructured data
- Flexible schema
- Document, key-value, or graph based
- High scalability
- Popular tools: MongoDB, Cassandra, DynamoDB, Redis
- Best use cases: Real-time apps, big data systems, IoT platforms, rapidly changing products
- Job roles: Backend Developer, Data Engineer, Cloud Engineer, Platform Engineer
- Hiring reality: Strong demand in startups, common in cloud-native systems, often paired with SQL
- India salary range: Fresher (5-8 LPA), Mid-level (10-22 LPA)
- Real tasks: Store JSON documents, handle large traffic, design scalable schemas, optimize read and write speed
Quick Comparison
- Schema: SQL (fixed), NoSQL (flexible)
- Scaling: SQL (vertical), NoSQL (horizontal)
- Consistency: SQL (strong), NoSQL (eventual)
- Queries: SQL (powerful), NoSQL (simpler)
Role-based Choice
- Data Analyst: SQL required
- Backend Developer: Both useful
- Data Engineer: SQL + NoSQL
- Startup products: NoSQL preferred
Best Career Move
- Learn SQL first
- Add NoSQL for modern systems
- Use both in real projects
Which one do you prefer?
SQL โค๏ธ
NoSQL ๐
Both ๐
None ๐ฎ
SQL Databases
- Structured data
- Fixed schema
- Table-based storage
- Strong consistency
- Popular tools: MySQL, PostgreSQL, SQL Server, Oracle
- Best use cases: Banking systems, ERP and CRM, transaction-heavy apps, reporting and analytics
- Job roles: Data Analyst, Backend Developer, Database Engineer, BI Developer
- Hiring reality: Mandatory in enterprises, core skill for analytics roles, used in almost every company
- India salary range: Fresher (4-7 LPA), Mid-level (8-18 LPA)
- Real tasks: Write complex queries, join multiple tables, build reports, ensure data integrity
NoSQL Databases
- Semi-structured or unstructured data
- Flexible schema
- Document, key-value, or graph based
- High scalability
- Popular tools: MongoDB, Cassandra, DynamoDB, Redis
- Best use cases: Real-time apps, big data systems, IoT platforms, rapidly changing products
- Job roles: Backend Developer, Data Engineer, Cloud Engineer, Platform Engineer
- Hiring reality: Strong demand in startups, common in cloud-native systems, often paired with SQL
- India salary range: Fresher (5-8 LPA), Mid-level (10-22 LPA)
- Real tasks: Store JSON documents, handle large traffic, design scalable schemas, optimize read and write speed
Quick Comparison
- Schema: SQL (fixed), NoSQL (flexible)
- Scaling: SQL (vertical), NoSQL (horizontal)
- Consistency: SQL (strong), NoSQL (eventual)
- Queries: SQL (powerful), NoSQL (simpler)
Role-based Choice
- Data Analyst: SQL required
- Backend Developer: Both useful
- Data Engineer: SQL + NoSQL
- Startup products: NoSQL preferred
Best Career Move
- Learn SQL first
- Add NoSQL for modern systems
- Use both in real projects
Which one do you prefer?
SQL โค๏ธ
NoSQL ๐
Both ๐
None ๐ฎ
โค10๐คฃ2๐1๐1
โ
If you're serious about learning Data Analytics โ follow this roadmap ๐๐ง
1. Learn Excel basics โ formulas, pivot tables, charts
2. Master SQL โ SELECT, JOIN, GROUP BY, CTEs, window functions
3. Get good at Python โ especially Pandas, NumPy, Matplotlib, Seaborn
4. Understand statistics โ mean, median, standard deviation, correlation, hypothesis testing
5. Clean and wrangle data โ handle missing values, outliers, normalization, encoding
6. Practice Exploratory Data Analysis (EDA) โ univariate, bivariate analysis
7. Work on real datasets โ sales, customer, finance, healthcare, etc.
8. Use Power BI or Tableau โ create dashboards and data stories
9. Learn business metrics KPIs โ retention rate, CLV, ROI, conversion rate
10. Build mini-projects โ sales dashboard, HR analytics, customer segmentation
11. Understand A/B Testing โ setup, analysis, significance
12. Practice SQL + Python combo โ extract, clean, visualize, analyze
13. Learn about data pipelines โ basic ETL concepts, Airflow, dbt
14. Use version control โ Git GitHub for all projects
15. Document your analysis โ use Jupyter or Notion to explain insights
16. Practice storytelling with data โ explain โso what?โ clearly
17. Know how to answer business questions using data
18. Explore cloud tools (optional) โ BigQuery, AWS S3, Redshift
19. Solve case studies โ product analysis, churn, marketing impact
20. Apply for internships/freelance โ gain experience + build resume
21. Post your projects on GitHub or portfolio site
22. Prepare for interviews โ SQL, Python, scenario-based questions
23. Keep learning โ YouTube, courses, Kaggle, LinkedIn Learning
๐ก Tip: Focus on building 3โ5 strong projects and learn to explain them in interviews.
๐ฌ Tap โค๏ธ for more!
1. Learn Excel basics โ formulas, pivot tables, charts
2. Master SQL โ SELECT, JOIN, GROUP BY, CTEs, window functions
3. Get good at Python โ especially Pandas, NumPy, Matplotlib, Seaborn
4. Understand statistics โ mean, median, standard deviation, correlation, hypothesis testing
5. Clean and wrangle data โ handle missing values, outliers, normalization, encoding
6. Practice Exploratory Data Analysis (EDA) โ univariate, bivariate analysis
7. Work on real datasets โ sales, customer, finance, healthcare, etc.
8. Use Power BI or Tableau โ create dashboards and data stories
9. Learn business metrics KPIs โ retention rate, CLV, ROI, conversion rate
10. Build mini-projects โ sales dashboard, HR analytics, customer segmentation
11. Understand A/B Testing โ setup, analysis, significance
12. Practice SQL + Python combo โ extract, clean, visualize, analyze
13. Learn about data pipelines โ basic ETL concepts, Airflow, dbt
14. Use version control โ Git GitHub for all projects
15. Document your analysis โ use Jupyter or Notion to explain insights
16. Practice storytelling with data โ explain โso what?โ clearly
17. Know how to answer business questions using data
18. Explore cloud tools (optional) โ BigQuery, AWS S3, Redshift
19. Solve case studies โ product analysis, churn, marketing impact
20. Apply for internships/freelance โ gain experience + build resume
21. Post your projects on GitHub or portfolio site
22. Prepare for interviews โ SQL, Python, scenario-based questions
23. Keep learning โ YouTube, courses, Kaggle, LinkedIn Learning
๐ก Tip: Focus on building 3โ5 strong projects and learn to explain them in interviews.
๐ฌ Tap โค๏ธ for more!
โค8๐1
Data Analyst Interview Questions & Preparation Tips
Be prepared with a mix of technical, analytical, and business-oriented interview questions.
1. Technical Questions (Data Analysis & Reporting)
SQL Questions:
How do you write a query to fetch the top 5 highest revenue-generating customers?
Explain the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN.
How would you optimize a slow-running query?
What are CTEs and when would you use them?
Data Visualization (Power BI / Tableau / Excel)
How would you create a dashboard to track key performance metrics?
Explain the difference between measures and calculated columns in Power BI.
How do you handle missing data in Tableau?
What are DAX functions, and can you give an example?
ETL & Data Processing (Alteryx, Power BI, Excel)
What is ETL, and how does it relate to BI?
Have you used Alteryx for data transformation? Explain a complex workflow you built.
How do you automate reporting using Power Query in Excel?
2. Business and Analytical Questions
How do you define KPIs for a business process?
Give an example of how you used data to drive a business decision.
How would you identify cost-saving opportunities in a reporting process?
Explain a time when your report uncovered a hidden business insight.
3. Scenario-Based & Behavioral Questions
Stakeholder Management:
How do you handle a situation where different business units have conflicting reporting requirements?
How do you explain complex data insights to non-technical stakeholders?
Problem-Solving & Debugging:
What would you do if your report is showing incorrect numbers?
How do you ensure the accuracy of a new KPI you introduced?
Project Management & Process Improvement:
Have you led a project to automate or improve a reporting process?
What steps do you take to ensure the timely delivery of reports?
4. Industry-Specific Questions (Credit Reporting & Financial Services)
What are some key credit risk metrics used in financial services?
How would you analyze trends in customer credit behavior?
How do you ensure compliance and data security in reporting?
5. General HR Questions
Why do you want to work at this company?
Tell me about a challenging project and how you handled it.
What are your strengths and weaknesses?
Where do you see yourself in five years?
How to Prepare?
Brush up on SQL, Power BI, and ETL tools (especially Alteryx).
Learn about key financial and credit reporting metrics.(varies company to company)
Practice explaining data-driven insights in a business-friendly manner.
Be ready to showcase problem-solving skills with real-world examples.
React with โค๏ธ if you want me to also post sample answer for the above questions
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
Be prepared with a mix of technical, analytical, and business-oriented interview questions.
1. Technical Questions (Data Analysis & Reporting)
SQL Questions:
How do you write a query to fetch the top 5 highest revenue-generating customers?
Explain the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN.
How would you optimize a slow-running query?
What are CTEs and when would you use them?
Data Visualization (Power BI / Tableau / Excel)
How would you create a dashboard to track key performance metrics?
Explain the difference between measures and calculated columns in Power BI.
How do you handle missing data in Tableau?
What are DAX functions, and can you give an example?
ETL & Data Processing (Alteryx, Power BI, Excel)
What is ETL, and how does it relate to BI?
Have you used Alteryx for data transformation? Explain a complex workflow you built.
How do you automate reporting using Power Query in Excel?
2. Business and Analytical Questions
How do you define KPIs for a business process?
Give an example of how you used data to drive a business decision.
How would you identify cost-saving opportunities in a reporting process?
Explain a time when your report uncovered a hidden business insight.
3. Scenario-Based & Behavioral Questions
Stakeholder Management:
How do you handle a situation where different business units have conflicting reporting requirements?
How do you explain complex data insights to non-technical stakeholders?
Problem-Solving & Debugging:
What would you do if your report is showing incorrect numbers?
How do you ensure the accuracy of a new KPI you introduced?
Project Management & Process Improvement:
Have you led a project to automate or improve a reporting process?
What steps do you take to ensure the timely delivery of reports?
4. Industry-Specific Questions (Credit Reporting & Financial Services)
What are some key credit risk metrics used in financial services?
How would you analyze trends in customer credit behavior?
How do you ensure compliance and data security in reporting?
5. General HR Questions
Why do you want to work at this company?
Tell me about a challenging project and how you handled it.
What are your strengths and weaknesses?
Where do you see yourself in five years?
How to Prepare?
Brush up on SQL, Power BI, and ETL tools (especially Alteryx).
Learn about key financial and credit reporting metrics.(varies company to company)
Practice explaining data-driven insights in a business-friendly manner.
Be ready to showcase problem-solving skills with real-world examples.
React with โค๏ธ if you want me to also post sample answer for the above questions
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
โค4๐1
๐ฃ๐ฎ๐ ๐๐ณ๐๐ฒ๐ฟ ๐ฃ๐น๐ฎ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ - ๐๐ฒ๐ ๐ฆ๐ฎ๐น๐ฎ๐ฟ๐ ๐ฃ๐ฎ๐ฐ๐ธ๐ฎ๐ด๐ฒ ๐จ๐ฝ๐๐ผ ๐ฐ๐ญ๐๐ฃ๐ ๐
Upskill on the most in-demand skills in the market
Learn Coding & Get Placed In Top Tech Companies
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:-
๐ผ Avg. Package: โน7.2 LPA | Highest: โน41 LPA
๐๐๐ ๐ข๐ฌ๐ญ๐๐ซ ๐๐จ๐ฐ ๐:-
https://pdlink.in/42WOE5H
Hurry! Limited seats are available.๐โโ๏ธ
Upskill on the most in-demand skills in the market
Learn Coding & Get Placed In Top Tech Companies
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:-
๐ผ Avg. Package: โน7.2 LPA | Highest: โน41 LPA
๐๐๐ ๐ข๐ฌ๐ญ๐๐ซ ๐๐จ๐ฐ ๐:-
https://pdlink.in/42WOE5H
Hurry! Limited seats are available.๐โโ๏ธ
๐คฃ4
SQL Interview Questions !!
๐ Write a query to find all employees whose salaries exceed the company's average salary.
๐ Write a query to retrieve the names of employees who work in the same department as 'John Doe'.
๐ Write a query to display the second highest salary from the Employee table without using the MAX function twice.
๐ Write a query to find all customers who have placed more than five orders.
๐ Write a query to count the total number of orders placed by each customer.
๐ Write a query to list employees who joined the company within the last 6 months.
๐ Write a query to calculate the total sales amount for each product.
๐ Write a query to list all products that have never been sold.
๐ Write a query to remove duplicate rows from a table.
๐ Write a query to identify the top 10 customers who have not placed any orders in the past year.
Here you can find essential SQL Interview Resources๐
https://t.me/mysqldata
Like this post if you need more ๐โค๏ธ
Hope it helps :)
๐ Write a query to find all employees whose salaries exceed the company's average salary.
๐ Write a query to retrieve the names of employees who work in the same department as 'John Doe'.
๐ Write a query to display the second highest salary from the Employee table without using the MAX function twice.
๐ Write a query to find all customers who have placed more than five orders.
๐ Write a query to count the total number of orders placed by each customer.
๐ Write a query to list employees who joined the company within the last 6 months.
๐ Write a query to calculate the total sales amount for each product.
๐ Write a query to list all products that have never been sold.
๐ Write a query to remove duplicate rows from a table.
๐ Write a query to identify the top 10 customers who have not placed any orders in the past year.
Here you can find essential SQL Interview Resources๐
https://t.me/mysqldata
Like this post if you need more ๐โค๏ธ
Hope it helps :)
โค5๐1
๐ ๐ง๐ผ๐ฝ ๐ฐ ๐๐ฅ๐๐ ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป๐ ๐ง๐ผ ๐๐ฒ๐ฎ๐ฟ๐ป ๐๐ฎ๐๐ฎ ๐ถ๐ป ๐ฎ๐ฌ๐ฎ๐ฒ ๐
Want to become a Data Analyst or Data Scientist? ๐
These FREE certifications can help you build job-ready skills & strengthen your resume ๐ฅ
โจ Learn:
โ SQL & Data Analytics
โ Power BI Dashboards ๐
โ Data Cleaning & Visualization
โ AI & Machine Learning Basics ๐ค
๐ฏ FREE + Beginner Friendly
๐๐ป๐ฟ๐ผ๐น๐น ๐๐ผ๐ฟ ๐๐ฅ๐๐๐:-
https://pdlink.in/4dsdTCV
๐ Perfect for Students, Freshers & Career Switchers
Want to become a Data Analyst or Data Scientist? ๐
These FREE certifications can help you build job-ready skills & strengthen your resume ๐ฅ
โจ Learn:
โ SQL & Data Analytics
โ Power BI Dashboards ๐
โ Data Cleaning & Visualization
โ AI & Machine Learning Basics ๐ค
๐ฏ FREE + Beginner Friendly
๐๐ป๐ฟ๐ผ๐น๐น ๐๐ผ๐ฟ ๐๐ฅ๐๐๐:-
https://pdlink.in/4dsdTCV
๐ Perfect for Students, Freshers & Career Switchers
โค1
๐๏ธ SQL Developer Roadmap
๐ SQL Basics (SELECT, WHERE, ORDER BY)
โ๐ Joins (INNER, LEFT, RIGHT, FULL)
โ๐ Aggregate Functions (COUNT, SUM, AVG)
โ๐ Grouping Data (GROUP BY, HAVING)
โ๐ Subqueries & Nested Queries
โ๐ Data Modification (INSERT, UPDATE, DELETE)
โ๐ Database Design (Normalization, Keys)
โ๐ Indexing & Query Optimization
โ๐ Stored Procedures & Functions
โ๐ Transactions & Locks
โ๐ Views & Triggers
โ๐ Backup & Restore
โ๐ Working with NoSQL basics (optional)
โ๐ Real Projects & Practice
โโ Apply for SQL Dev Roles
โค๏ธ React for More!
๐ SQL Basics (SELECT, WHERE, ORDER BY)
โ๐ Joins (INNER, LEFT, RIGHT, FULL)
โ๐ Aggregate Functions (COUNT, SUM, AVG)
โ๐ Grouping Data (GROUP BY, HAVING)
โ๐ Subqueries & Nested Queries
โ๐ Data Modification (INSERT, UPDATE, DELETE)
โ๐ Database Design (Normalization, Keys)
โ๐ Indexing & Query Optimization
โ๐ Stored Procedures & Functions
โ๐ Transactions & Locks
โ๐ Views & Triggers
โ๐ Backup & Restore
โ๐ Working with NoSQL basics (optional)
โ๐ Real Projects & Practice
โโ Apply for SQL Dev Roles
โค๏ธ React for More!
โค14๐1
Want to start your career in ๐๐ & ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ๐?
Learn from IIIT Bangalore & upGrad
๐ซ Beginner Friendly
๐ซ Industry Recognized Certificate
๐ซHigh Demand Career Skills
๐๐ผ๐ผ๐ธ ๐๐ฅ๐๐ ๐๐ผ๐๐ป๐๐ฒ๐น๐น๐ถ๐ป๐ด๐Now & explore your career roadmap
https://pdlink.in/4twH9xg
๐Top roles you can target:
* Data Analyst , AI Engineer ,Machine Learning Engineer & Data Scientist
Learn from IIIT Bangalore & upGrad
๐ซ Beginner Friendly
๐ซ Industry Recognized Certificate
๐ซHigh Demand Career Skills
๐๐ผ๐ผ๐ธ ๐๐ฅ๐๐ ๐๐ผ๐๐ป๐๐ฒ๐น๐น๐ถ๐ป๐ด๐Now & explore your career roadmap
https://pdlink.in/4twH9xg
๐Top roles you can target:
* Data Analyst , AI Engineer ,Machine Learning Engineer & Data Scientist
โค2๐คฃ1
SQL interview questions with answers ๐๐
1. Question: What is SQL?
Answer: SQL (Structured Query Language) is a programming language designed for managing and manipulating relational databases. It is used to query, insert, update, and delete data in databases.
2. Question: Differentiate between SQL and MySQL.
Answer: SQL is a language for managing relational databases, while MySQL is an open-source relational database management system (RDBMS) that uses SQL as its language.
3. Question: Explain the difference between INNER JOIN and LEFT JOIN.
Answer: INNER JOIN returns rows when there is a match in both tables, while LEFT JOIN returns all rows from the left table and the matched rows from the right table, filling in with NULLs for non-matching rows.
4. Question: How do you remove duplicate records from a table?
Answer: Use the
5. Question: What is a subquery in SQL?
Answer: A subquery is a query nested inside another query. It can be used to retrieve data that will be used in the main query as a condition to further restrict the data to be retrieved.
6. Question: Explain the purpose of the GROUP BY clause.
Answer: The GROUP BY clause is used to group rows that have the same values in specified columns into summary rows, like when using aggregate functions such as COUNT, SUM, AVG, etc.
7. Question: How can you add a new record to a table?
Answer: Use the
8. Question: What is the purpose of the HAVING clause?
Answer: The HAVING clause is used in combination with the GROUP BY clause to filter the results of aggregate functions based on a specified condition.
9. Question: Explain the concept of normalization in databases.
Answer: Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It involves breaking down tables into smaller, related tables.
10. Question: How do you update data in a table in SQL?
Answer: Use the
Here is an amazing resources to learn & practice SQL: https://bit.ly/3FxxKPz
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
1. Question: What is SQL?
Answer: SQL (Structured Query Language) is a programming language designed for managing and manipulating relational databases. It is used to query, insert, update, and delete data in databases.
2. Question: Differentiate between SQL and MySQL.
Answer: SQL is a language for managing relational databases, while MySQL is an open-source relational database management system (RDBMS) that uses SQL as its language.
3. Question: Explain the difference between INNER JOIN and LEFT JOIN.
Answer: INNER JOIN returns rows when there is a match in both tables, while LEFT JOIN returns all rows from the left table and the matched rows from the right table, filling in with NULLs for non-matching rows.
4. Question: How do you remove duplicate records from a table?
Answer: Use the
DISTINCT keyword in a SELECT statement to retrieve unique records. For example: SELECT DISTINCT column1, column2 FROM table;5. Question: What is a subquery in SQL?
Answer: A subquery is a query nested inside another query. It can be used to retrieve data that will be used in the main query as a condition to further restrict the data to be retrieved.
6. Question: Explain the purpose of the GROUP BY clause.
Answer: The GROUP BY clause is used to group rows that have the same values in specified columns into summary rows, like when using aggregate functions such as COUNT, SUM, AVG, etc.
7. Question: How can you add a new record to a table?
Answer: Use the
INSERT INTO statement. For example: INSERT INTO table_name (column1, column2) VALUES (value1, value2);8. Question: What is the purpose of the HAVING clause?
Answer: The HAVING clause is used in combination with the GROUP BY clause to filter the results of aggregate functions based on a specified condition.
9. Question: Explain the concept of normalization in databases.
Answer: Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It involves breaking down tables into smaller, related tables.
10. Question: How do you update data in a table in SQL?
Answer: Use the
UPDATE statement to modify existing records in a table. For example: UPDATE table_name SET column1 = value1 WHERE condition;Here is an amazing resources to learn & practice SQL: https://bit.ly/3FxxKPz
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
โค9
๐๏ธ ๐ง๐ผ๐ฝ ๐ฑ ๐๐ฅ๐๐ ๐ฆ๐ค๐ ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐
SQL is one of the most important skills for Data Analyst & Tech jobs in 2026 ๐ฅ
These FREE certification courses can help you learn SQL from scratch & boost your resume ๐ผ
โจ Learn:
โ SQL Queries & Databases ๐๏ธ
โ Data Analysis Basics ๐
โ Real-world Projects
โ Beginner to Advanced Concepts
๐๐ป๐ฟ๐ผ๐น๐น ๐๐ผ๐ฟ ๐๐ฅ๐๐๐:-
https://pdlink.in/4dCHiKI
๐ฏ Beginner Friendly + FREE Certificates ๐
๐ผ Perfect for Students, Freshers & Career Switchers
SQL is one of the most important skills for Data Analyst & Tech jobs in 2026 ๐ฅ
These FREE certification courses can help you learn SQL from scratch & boost your resume ๐ผ
โจ Learn:
โ SQL Queries & Databases ๐๏ธ
โ Data Analysis Basics ๐
โ Real-world Projects
โ Beginner to Advanced Concepts
๐๐ป๐ฟ๐ผ๐น๐น ๐๐ผ๐ฟ ๐๐ฅ๐๐๐:-
https://pdlink.in/4dCHiKI
๐ฏ Beginner Friendly + FREE Certificates ๐
๐ผ Perfect for Students, Freshers & Career Switchers
โ
Useful SQL Concepts You Should Know ๐๐
1๏ธโฃ Constraints in SQL:
- PRIMARY KEY โ Uniquely identifies each row
- FOREIGN KEY โ Links to another table
- UNIQUE โ Ensures all values are different
- NOT NULL โ Column must have a value
- CHECK โ Validates data before insert/update
2๏ธโฃ SQL Views:
Virtual tables based on result of a query
CREATE VIEW top_students AS
SELECT name, marks FROM students WHERE marks > 90;
3๏ธโฃ Indexing:
Improves query performance
CREATE INDEX idx_name ON employees(name);
4๏ธโฃ SQL Transactions:
Ensure data integrity
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;
5๏ธโฃ Triggers:
Automatic actions when events occur
CREATE TRIGGER log_update
AFTER UPDATE ON employees
FOR EACH ROW
INSERT INTO logs(action) VALUES ('Employee updated');
6๏ธโฃ Stored Procedures:
Reusable blocks of SQL logic
CREATE PROCEDURE getTopStudents()
BEGIN
SELECT FROM students WHERE marks > 90;
END;
7๏ธโฃ Common Table Expressions (CTEs):
Temporary named result sets
WITH dept_count AS (
SELECT department, COUNT() AS total FROM employees GROUP BY department
)
SELECT FROM dept_count;
๐ฌ Double Tap โค๏ธ For More!
1๏ธโฃ Constraints in SQL:
- PRIMARY KEY โ Uniquely identifies each row
- FOREIGN KEY โ Links to another table
- UNIQUE โ Ensures all values are different
- NOT NULL โ Column must have a value
- CHECK โ Validates data before insert/update
2๏ธโฃ SQL Views:
Virtual tables based on result of a query
CREATE VIEW top_students AS
SELECT name, marks FROM students WHERE marks > 90;
3๏ธโฃ Indexing:
Improves query performance
CREATE INDEX idx_name ON employees(name);
4๏ธโฃ SQL Transactions:
Ensure data integrity
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;
5๏ธโฃ Triggers:
Automatic actions when events occur
CREATE TRIGGER log_update
AFTER UPDATE ON employees
FOR EACH ROW
INSERT INTO logs(action) VALUES ('Employee updated');
6๏ธโฃ Stored Procedures:
Reusable blocks of SQL logic
CREATE PROCEDURE getTopStudents()
BEGIN
SELECT FROM students WHERE marks > 90;
END;
7๏ธโฃ Common Table Expressions (CTEs):
Temporary named result sets
WITH dept_count AS (
SELECT department, COUNT() AS total FROM employees GROUP BY department
)
SELECT FROM dept_count;
๐ฌ Double Tap โค๏ธ For More!
โค5
SQL Interview Questions with Answers Part-1: โ๏ธ
1. What is SQL?
SQL (Structured Query Language) is a standardized programming language designed to manage and manipulate relational databases. It allows you to query, insert, update, and delete data, as well as create and modify schema objects like tables and views.
2. Differentiate between SQL and NoSQL databases.
SQL databases are relational, table-based, and use structured query language with fixed schemas, ideal for complex queries and transactions. NoSQL databases are non-relational, can be document, key-value, graph, or column-oriented, and are schema-flexible, designed for scalability and handling unstructured data.
3. What are the different types of SQL commands?
โฆ DDL (Data Definition Language): CREATE, ALTER, DROP (define and modify structure)
โฆ DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE (data operations)
โฆ DCL (Data Control Language): GRANT, REVOKE (permission control)
โฆ TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT (transaction management)
4. Explain the difference between WHERE and HAVING clauses.
โฆ
โฆ
5. Write a SQL query to find the second highest salary in a table.
Using a subquery:
Or using DENSE_RANK():
6. What is a JOIN? Explain different types of JOINs.
A JOIN combines rows from two or more tables based on a related column:
โฆ INNER JOIN: returns matching rows from both tables.
โฆ LEFT JOIN (LEFT OUTER JOIN): all rows from the left table, matched rows from right.
โฆ RIGHT JOIN (RIGHT OUTER JOIN): all rows from right table, matched rows from left.
โฆ FULL JOIN (FULL OUTER JOIN): all rows when thereโs a match in either table.
โฆ CROSS JOIN: Cartesian product of both tables.
7. How do you optimize slow-performing SQL queries?
โฆ Use indexes appropriately to speed up lookups.
โฆ Avoid SELECT *; only select necessary columns.
โฆ Use joins carefully; filter early with WHERE clauses.
โฆ Analyze execution plans to identify bottlenecks.
โฆ Avoid unnecessary subqueries; use EXISTS or JOINs.
โฆ Limit result sets with pagination if dealing with large datasets.
8. What is a primary key? What is a foreign key?
โฆ Primary Key: A unique identifier for records in a table; it cannot be NULL.
โฆ Foreign Key: A field that creates a link between two tables by referring to the primary key in another table, enforcing referential integrity.
9. What are indexes? Explain clustered and non-clustered indexes.
โฆ Indexes speed up data retrieval by providing quick lookups.
โฆ Clustered Index: Sorts and stores the actual data rows in the table based on the key; a table can have only one clustered index.
โฆ Non-Clustered Index: Creates a separate structure that points to the data rows; tables can have multiple non-clustered indexes.
10. Write a SQL query to fetch the top 5 records from a table.
In SQL Server and PostgreSQL:
In SQL Server (older syntax):
React โฅ๏ธ for Part 2
1. What is SQL?
SQL (Structured Query Language) is a standardized programming language designed to manage and manipulate relational databases. It allows you to query, insert, update, and delete data, as well as create and modify schema objects like tables and views.
2. Differentiate between SQL and NoSQL databases.
SQL databases are relational, table-based, and use structured query language with fixed schemas, ideal for complex queries and transactions. NoSQL databases are non-relational, can be document, key-value, graph, or column-oriented, and are schema-flexible, designed for scalability and handling unstructured data.
3. What are the different types of SQL commands?
โฆ DDL (Data Definition Language): CREATE, ALTER, DROP (define and modify structure)
โฆ DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE (data operations)
โฆ DCL (Data Control Language): GRANT, REVOKE (permission control)
โฆ TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT (transaction management)
4. Explain the difference between WHERE and HAVING clauses.
โฆ
WHERE filters rows before grouping (used with SELECT, UPDATE).โฆ
HAVING filters groups after aggregation (used with GROUP BY), e.g., filtering aggregated results like sums or counts.5. Write a SQL query to find the second highest salary in a table.
Using a subquery:
SELECT MAX(salary) FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
Or using DENSE_RANK():
SELECT salary FROM (
SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) as rnk
FROM employees) t
WHERE rnk = 2;
6. What is a JOIN? Explain different types of JOINs.
A JOIN combines rows from two or more tables based on a related column:
โฆ INNER JOIN: returns matching rows from both tables.
โฆ LEFT JOIN (LEFT OUTER JOIN): all rows from the left table, matched rows from right.
โฆ RIGHT JOIN (RIGHT OUTER JOIN): all rows from right table, matched rows from left.
โฆ FULL JOIN (FULL OUTER JOIN): all rows when thereโs a match in either table.
โฆ CROSS JOIN: Cartesian product of both tables.
7. How do you optimize slow-performing SQL queries?
โฆ Use indexes appropriately to speed up lookups.
โฆ Avoid SELECT *; only select necessary columns.
โฆ Use joins carefully; filter early with WHERE clauses.
โฆ Analyze execution plans to identify bottlenecks.
โฆ Avoid unnecessary subqueries; use EXISTS or JOINs.
โฆ Limit result sets with pagination if dealing with large datasets.
8. What is a primary key? What is a foreign key?
โฆ Primary Key: A unique identifier for records in a table; it cannot be NULL.
โฆ Foreign Key: A field that creates a link between two tables by referring to the primary key in another table, enforcing referential integrity.
9. What are indexes? Explain clustered and non-clustered indexes.
โฆ Indexes speed up data retrieval by providing quick lookups.
โฆ Clustered Index: Sorts and stores the actual data rows in the table based on the key; a table can have only one clustered index.
โฆ Non-Clustered Index: Creates a separate structure that points to the data rows; tables can have multiple non-clustered indexes.
10. Write a SQL query to fetch the top 5 records from a table.
In SQL Server and PostgreSQL:
SELECT * FROM table_name
ORDER BY some_column DESC
LIMIT 5;
In SQL Server (older syntax):
SELECT TOP 5 * FROM table_name
ORDER BY some_column DESC;
React โฅ๏ธ for Part 2
โค14
๐๐ ๐ฎ๐ป๐ฑ ๐ ๐ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ ๐ฏ๐ ๐๐๐, ๐๐๐ง ๐ ๐ฎ๐ป๐ฑ๐ถ๐
Freshers get 15 LPA Average Salary with AI & ML Skills!
๐ป 100% Online
โณ 6 Months Duration
๐จโ๐ซ Learn from IIT Professors
๐ Open for Students ,Freshers & Working Professionals
๐ผ Placement Assistance with 5000+ Companies
๐ High Demand Skills for Future Tech Jobs
Top companies are hiring for candidates with ๐๐, ๐ ๐ฎ๐ฐ๐ต๐ถ๐ป๐ฒ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด skills in 2026
๐ฅDeadline :- 17th May
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐ :-
https://pdlink.in/4nmI024
.
Get Placement Assistance With 5000+ Companies
Freshers get 15 LPA Average Salary with AI & ML Skills!
๐ป 100% Online
โณ 6 Months Duration
๐จโ๐ซ Learn from IIT Professors
๐ Open for Students ,Freshers & Working Professionals
๐ผ Placement Assistance with 5000+ Companies
๐ High Demand Skills for Future Tech Jobs
Top companies are hiring for candidates with ๐๐, ๐ ๐ฎ๐ฐ๐ต๐ถ๐ป๐ฒ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด skills in 2026
๐ฅDeadline :- 17th May
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐ :-
https://pdlink.in/4nmI024
.
Get Placement Assistance With 5000+ Companies
โค1
โ
Stored Procedures ๐ฏ
๐ง 1. What is a Stored Procedure?
A Stored Procedure is a saved SQL program
โข Stored inside the database
โข Can be executed anytime
Think like this ๐
โReusable SQL code blockโ
โก 2. Why Use Stored Procedures?
โข Reuse SQL logic
โข Reduce repeated code
โข Better security
โข Faster execution for repeated tasks
โก 3. Basic Syntax
๐ MySQL Example:
DELIMITER //
CREATE PROCEDURE GetEmployees()
BEGIN
SELECT * FROM employees;
END //
DELIMITER ;
โถ๏ธ 4. Execute Stored Procedure
CALL GetEmployees();
๐ฅ 5. Procedure with Parameter
DELIMITER //
CREATE PROCEDURE GetDeptEmployees(IN dept_name VARCHAR(50))
BEGIN
SELECT * FROM employees
WHERE department = dept_name;
END //
DELIMITER ;
โถ๏ธ 6. Execute Parameterized Procedure
CALL GetDeptEmployees('IT');
โ 7. Drop Stored Procedure
DROP PROCEDURE GetEmployees;
๐ฏ 8. Real Example
Increase salary for all IT employees:
DELIMITER //
CREATE PROCEDURE IncreaseSalary()
BEGIN
UPDATE employees
SET salary = salary + 5000
WHERE department = 'IT';
END //
DELIMITER ;
๐ฏ 9. Practice Tasks
1. Create procedure to show all employees
2. Create procedure for HR employees
3. Create procedure with salary parameter
4. Execute stored procedure
5. Drop procedure
โก Mini Challenge ๐ฅ
Create procedure to return employees with salary > given value
โ Solution
DELIMITER //
CREATE PROCEDURE GetHighSalaryEmployees(IN min_salary INT)
BEGIN
SELECT *
FROM employees
WHERE salary > min_salary;
END //
DELIMITER ;
โถ๏ธ Execute Procedure
CALL GetHighSalaryEmployees(50000);
โ Returns employees earning more than 50k
Key Difference:
โข Function โ returns value
โข Procedure โ performs action / multiple operations
Double Tap โค๏ธ For More
๐ง 1. What is a Stored Procedure?
A Stored Procedure is a saved SQL program
โข Stored inside the database
โข Can be executed anytime
Think like this ๐
โReusable SQL code blockโ
โก 2. Why Use Stored Procedures?
โข Reuse SQL logic
โข Reduce repeated code
โข Better security
โข Faster execution for repeated tasks
โก 3. Basic Syntax
๐ MySQL Example:
DELIMITER //
CREATE PROCEDURE GetEmployees()
BEGIN
SELECT * FROM employees;
END //
DELIMITER ;
โถ๏ธ 4. Execute Stored Procedure
CALL GetEmployees();
๐ฅ 5. Procedure with Parameter
DELIMITER //
CREATE PROCEDURE GetDeptEmployees(IN dept_name VARCHAR(50))
BEGIN
SELECT * FROM employees
WHERE department = dept_name;
END //
DELIMITER ;
โถ๏ธ 6. Execute Parameterized Procedure
CALL GetDeptEmployees('IT');
โ 7. Drop Stored Procedure
DROP PROCEDURE GetEmployees;
๐ฏ 8. Real Example
Increase salary for all IT employees:
DELIMITER //
CREATE PROCEDURE IncreaseSalary()
BEGIN
UPDATE employees
SET salary = salary + 5000
WHERE department = 'IT';
END //
DELIMITER ;
๐ฏ 9. Practice Tasks
1. Create procedure to show all employees
2. Create procedure for HR employees
3. Create procedure with salary parameter
4. Execute stored procedure
5. Drop procedure
โก Mini Challenge ๐ฅ
Create procedure to return employees with salary > given value
โ Solution
DELIMITER //
CREATE PROCEDURE GetHighSalaryEmployees(IN min_salary INT)
BEGIN
SELECT *
FROM employees
WHERE salary > min_salary;
END //
DELIMITER ;
โถ๏ธ Execute Procedure
CALL GetHighSalaryEmployees(50000);
โ Returns employees earning more than 50k
Key Difference:
โข Function โ returns value
โข Procedure โ performs action / multiple operations
Double Tap โค๏ธ For More
โค3
๐ ๐๐ฒ๐ฐ๐ผ๐บ๐ฒ ๐๐ผ๐ฏ-๐ฅ๐ฒ๐ฎ๐ฑ๐ ๐ถ๐ป ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ & ๐๐ ๐๐ถ๐๐ต ๐๐ป๐ฑ๐๐๐๐ฟ๐ ๐๐
๐ฝ๐ฒ๐ฟ๐๐! ๐
Learn the most in-demand skills of 2026
๐ซData Science ,AI,ML &Python & SQL
โ
๐ผ Get Placement Assistance
๐ Beginner Friendly Program
๐ป Learn Online from Anywhere
๐ Build Skills Companies Actually Hire For
๐ฅ AI is changing every industry โ this is the best time to upskill and secure high-paying tech jobs.
๐๐๐ ๐ข๐ฌ๐ญ๐๐ซ ๐๐จ๐ฐ ๐:-
https://pdlink.in/4fdWxJB
โก Limited Seats Available โ Apply Fast!
Learn the most in-demand skills of 2026
๐ซData Science ,AI,ML &Python & SQL
โ
๐ผ Get Placement Assistance
๐ Beginner Friendly Program
๐ป Learn Online from Anywhere
๐ Build Skills Companies Actually Hire For
๐ฅ AI is changing every industry โ this is the best time to upskill and secure high-paying tech jobs.
๐๐๐ ๐ข๐ฌ๐ญ๐๐ซ ๐๐จ๐ฐ ๐:-
https://pdlink.in/4fdWxJB
โก Limited Seats Available โ Apply Fast!
โค1
What is a Stored Procedure?
Anonymous Quiz
6%
A. A table
83%
B. A saved SQL program stored in database
7%
C. A database index
4%
D. A view
Which command is used to execute a stored procedure in MySQL?
Anonymous Quiz
54%
A. EXECUTE
20%
B. RUN
22%
C. CALL
4%
D. START
Which keyword is used to pass input parameter in MySQL procedure?
Anonymous Quiz
4%
A. OUT
38%
B. INPUT
28%
C. PARAM
31%
D. IN
What is the advantage of stored procedures?
Anonymous Quiz
10%
A. Reduces code repetition
10%
B. Improves reusability
33%
C. Better performance for repeated execution
47%
D. All of the above
๐ฃ๐ฟ๐ผ๐ฑ๐๐ฐ๐ ๐ ๐ฎ๐ป๐ฎ๐ด๐ฒ๐บ๐ฒ๐ป๐ ๐๐ถ๐๐ต ๐๐ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ by iHUB IIT Roorkee ๐
Freshers get paid 12 LPA average salary for the role of Associate Product Manager! ๐ผ
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:
โ Learn from IIT Roorkee Professors
โ Placement support from 5,000+ companies
โ Professional Certification in Product Management with Applied AI
โ 100% Online Program
โ Open to Everyone
๐ ๐๐ฒ๐ฎ๐ฑ๐น๐ถ๐ป๐ฒ: 17th May 2026
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐ :-
https://pdlink.in/4ddJZ5C
โก Limited Seats Available โ Apply Soon!
Freshers get paid 12 LPA average salary for the role of Associate Product Manager! ๐ผ
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:
โ Learn from IIT Roorkee Professors
โ Placement support from 5,000+ companies
โ Professional Certification in Product Management with Applied AI
โ 100% Online Program
โ Open to Everyone
๐ ๐๐ฒ๐ฎ๐ฑ๐น๐ถ๐ป๐ฒ: 17th May 2026
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐ :-
https://pdlink.in/4ddJZ5C
โก Limited Seats Available โ Apply Soon!
๐ฅ Now, letโs move to the next topic:
Triggers in SQL
(Automation inside database ๐ฏ)
๐ง 1. What is a Trigger?
A Trigger is a special SQL block
๐ that runs automatically
๐ when an event happens in a table
Think like this ๐
๐ โAutomatic action on INSERT / UPDATE / DELETEโ
โก 2. Why Use Triggers?
โ Automatic logging
โ Data validation
โ Audit tracking
โ Prevent invalid operations
โก 3. Types of Triggers
BEFORE INSERT โ Runs before inserting data
AFTER INSERT โ Runs after inserting data
BEFORE UPDATE โ Runs before updating
AFTER UPDATE โ Runs after updating
BEFORE DELETE โ Runs before deleting
AFTER DELETE โ Runs after deleting
๐ฅ 4. Basic Trigger Example
๐ Automatically log inserted employee
CREATE TABLE employee_log (
log_message VARCHAR(255)
);
DELIMITER //
CREATE TRIGGER after_employee_insert
AFTER INSERT ON employees
FOR EACH ROW
BEGIN
INSERT INTO employee_log
VALUES (CONCAT('New employee added: ', NEW.name));
END //
DELIMITER ;
๐ง 5. Important Keywords
NEW โ New inserted/updated value
OLD โ Previous value before update/delete
โก 6. BEFORE UPDATE Example
๐ Prevent negative salary
DELIMITER //
CREATE TRIGGER check_salary
BEFORE UPDATE ON employees
FOR EACH ROW
BEGIN
IF NEW.salary < 0 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Salary cannot be negative';
END IF;
END //
DELIMITER ;
โ 7. Drop Trigger
DROP TRIGGER after_employee_insert;
๐ฏ 8. Practice Tasks
1. Create AFTER INSERT trigger
2. Create BEFORE UPDATE trigger
3. Prevent negative salary using trigger
4. Log deleted employees
5. Drop created trigger
โก Mini Challenge ๐ฅ
๐ Create trigger to automatically save deleted employee names into another table
๐ฅ Mini Challenge Solution
๐ Automatically save deleted employee names into another table
โ Step 1: Create Log Table
CREATE TABLE deleted_employees (
emp_id INT,
name VARCHAR(50),
deleted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
โ Step 2: Create Trigger
DELIMITER //
CREATE TRIGGER log_deleted_employee
AFTER DELETE ON employees
FOR EACH ROW
BEGIN
INSERT INTO deleted_employees(emp_id, name)
VALUES (OLD.emp_id, OLD.name);
END //
DELIMITER ;
๐ง How It Works
๐ AFTER DELETE โ runs automatically after deletion
๐ OLD.emp_id and OLD.name
Access deleted row values before they disappear
โ Example
DELETE FROM employees
WHERE emp_id = 101;
โ Deleted employee info automatically saved in deleted_employees table ๐ฏ
๐ฅ Pro Tip
Triggers are powerful but:
โ Too many triggers can slow database
โ Use them carefully ๐ฏ
Double Tap โค๏ธ For More
Triggers in SQL
(Automation inside database ๐ฏ)
๐ง 1. What is a Trigger?
A Trigger is a special SQL block
๐ that runs automatically
๐ when an event happens in a table
Think like this ๐
๐ โAutomatic action on INSERT / UPDATE / DELETEโ
โก 2. Why Use Triggers?
โ Automatic logging
โ Data validation
โ Audit tracking
โ Prevent invalid operations
โก 3. Types of Triggers
BEFORE INSERT โ Runs before inserting data
AFTER INSERT โ Runs after inserting data
BEFORE UPDATE โ Runs before updating
AFTER UPDATE โ Runs after updating
BEFORE DELETE โ Runs before deleting
AFTER DELETE โ Runs after deleting
๐ฅ 4. Basic Trigger Example
๐ Automatically log inserted employee
CREATE TABLE employee_log (
log_message VARCHAR(255)
);
DELIMITER //
CREATE TRIGGER after_employee_insert
AFTER INSERT ON employees
FOR EACH ROW
BEGIN
INSERT INTO employee_log
VALUES (CONCAT('New employee added: ', NEW.name));
END //
DELIMITER ;
๐ง 5. Important Keywords
NEW โ New inserted/updated value
OLD โ Previous value before update/delete
โก 6. BEFORE UPDATE Example
๐ Prevent negative salary
DELIMITER //
CREATE TRIGGER check_salary
BEFORE UPDATE ON employees
FOR EACH ROW
BEGIN
IF NEW.salary < 0 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Salary cannot be negative';
END IF;
END //
DELIMITER ;
โ 7. Drop Trigger
DROP TRIGGER after_employee_insert;
๐ฏ 8. Practice Tasks
1. Create AFTER INSERT trigger
2. Create BEFORE UPDATE trigger
3. Prevent negative salary using trigger
4. Log deleted employees
5. Drop created trigger
โก Mini Challenge ๐ฅ
๐ Create trigger to automatically save deleted employee names into another table
๐ฅ Mini Challenge Solution
๐ Automatically save deleted employee names into another table
โ Step 1: Create Log Table
CREATE TABLE deleted_employees (
emp_id INT,
name VARCHAR(50),
deleted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
โ Step 2: Create Trigger
DELIMITER //
CREATE TRIGGER log_deleted_employee
AFTER DELETE ON employees
FOR EACH ROW
BEGIN
INSERT INTO deleted_employees(emp_id, name)
VALUES (OLD.emp_id, OLD.name);
END //
DELIMITER ;
๐ง How It Works
๐ AFTER DELETE โ runs automatically after deletion
๐ OLD.emp_id and OLD.name
Access deleted row values before they disappear
โ Example
DELETE FROM employees
WHERE emp_id = 101;
โ Deleted employee info automatically saved in deleted_employees table ๐ฏ
๐ฅ Pro Tip
Triggers are powerful but:
โ Too many triggers can slow database
โ Use them carefully ๐ฏ
Double Tap โค๏ธ For More
โค5