What happens in underfitting?
Anonymous Quiz
7%
A) Model memorizes data
12%
B) Model learns patterns too well
78%
C) Model fails to learn patterns properly
3%
D) Model gives perfect predictions
❤3
Which condition is true for overfitting?
Anonymous Quiz
13%
A) Low training accuracy and high testing accuracy
79%
B) High training accuracy and poor testing accuracy
5%
C) Low accuracy everywhere
4%
D) Perfect testing accuracy only
❤5
Which of the following can help reduce overfitting?
Anonymous Quiz
12%
A) Smaller dataset
10%
B) Increasing noise
70%
C) Cross-validation
8%
D) Removing testing data
❤4
A balanced model should perform well on:
Anonymous Quiz
1%
A) Only training data
7%
B) Only testing data
90%
C) Both training and testing data
1%
D) Neither dataset
❤4
Which of the following may cause overfitting?
Anonymous Quiz
17%
A) Very simple model
54%
B) Too many features
18%
C) Less training
10%
D) Small model complexity
❤5
✅ Cross Validation & Hyperparameter Tuning 🤖⚙️
👉 Building a model is not enough.
We must also make sure it performs well on unseen data.
This is done using:
✔ Cross Validation
✔ Hyperparameter Tuning
🔹 1. What is Cross Validation?
Cross Validation checks how well a model generalizes to new data.
👉 Instead of using only one train-test split, data is divided multiple times.
🔥 2. K-Fold Cross Validation ⭐
How it Works:
1️⃣ Split data into K parts (folds)
2️⃣ Use one fold for testing
3️⃣ Use remaining folds for training
4️⃣ Repeat until every fold is tested
✅ Example
If K = 5:
• 4 folds → Training
• 1 fold → Testing
Repeated 5 times.
🔹 3. Why Cross Validation is Important?
✔ Better model evaluation
✔ Reduces overfitting risk
✔ More reliable accuracy
🔹 4. Implementation (Python)
🔥 5. What are Hyperparameters?
👉 Hyperparameters are settings controlled before training the model.
Examples:
✔ Number of trees in Random Forest
✔ Value of K in KNN
✔ Learning rate
🔹 6. Hyperparameter Tuning
👉 Finding the best settings for the model.
🔥 7. Grid Search ⭐
Grid Search tries multiple parameter combinations automatically.
✅ Example
👉 Tests different K values in KNN.
🔹 8. Why Tuning is Important?
✔ Improves model performance
✔ Increases accuracy
✔ Helps build optimized ML systems
🎯 Today’s Goal
✔ Understand cross validation
✔ Learn K-Fold method
✔ Understand hyperparameters
✔ Learn Grid Search basics
💬 Tap ❤️ for more!
👉 Building a model is not enough.
We must also make sure it performs well on unseen data.
This is done using:
✔ Cross Validation
✔ Hyperparameter Tuning
🔹 1. What is Cross Validation?
Cross Validation checks how well a model generalizes to new data.
👉 Instead of using only one train-test split, data is divided multiple times.
🔥 2. K-Fold Cross Validation ⭐
How it Works:
1️⃣ Split data into K parts (folds)
2️⃣ Use one fold for testing
3️⃣ Use remaining folds for training
4️⃣ Repeat until every fold is tested
✅ Example
If K = 5:
• 4 folds → Training
• 1 fold → Testing
Repeated 5 times.
🔹 3. Why Cross Validation is Important?
✔ Better model evaluation
✔ Reduces overfitting risk
✔ More reliable accuracy
🔹 4. Implementation (Python)
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
scores = cross_val_score(model, X, y, cv=5)
print(scores)
🔥 5. What are Hyperparameters?
👉 Hyperparameters are settings controlled before training the model.
Examples:
✔ Number of trees in Random Forest
✔ Value of K in KNN
✔ Learning rate
🔹 6. Hyperparameter Tuning
👉 Finding the best settings for the model.
🔥 7. Grid Search ⭐
Grid Search tries multiple parameter combinations automatically.
from sklearn.model_selection import GridSearchCV
✅ Example
params = {
"n_neighbors": [3,5,7]
}
👉 Tests different K values in KNN.
🔹 8. Why Tuning is Important?
✔ Improves model performance
✔ Increases accuracy
✔ Helps build optimized ML systems
🎯 Today’s Goal
✔ Understand cross validation
✔ Learn K-Fold method
✔ Understand hyperparameters
✔ Learn Grid Search basics
💬 Tap ❤️ for more!
❤14
What is the main purpose of Cross Validation?
Anonymous Quiz
5%
A) Clean data
8%
B) Improve visualization
87%
C) Evaluate model performance reliably
0%
D) Store datasets
❤2👍1
In K-Fold Cross Validation, what happens?
Anonymous Quiz
1%
A) Data is deleted
91%
B) Data is split into multiple folds
4%
C) Features are removed
4%
D) Model is visualized
❤2👍1
What are Hyperparameters?
Anonymous Quiz
6%
A) Output predictions
9%
B) Dataset columns
84%
C) Settings defined before training
2%
D) Missing values
❤1👍1
Which method is commonly used for Hyperparameter Tuning?
Anonymous Quiz
8%
A) Heatmap
55%
B) Grid Search
25%
C) PCA
12%
D) Clustering
❤1👍1
Which of the following is a hyperparameter in KNN?
Anonymous Quiz
7%
A) Accuracy
5%
B) Mean
83%
C) Number of neighbors (K)
5%
D) Target variable
❤2👍1
✅ End-to-End Machine Learning Project Workflow 🤖🚀
👉 Today you’ll learn how real-world ML projects are built from start to finish.
This is one of the most important topics for interviews and projects.
🔹 1. Problem Understanding
👉 First understand the business problem.
Example:
✔ Predict house prices
✔ Detect spam emails
✔ Customer churn prediction
🔥 2. Collect Data
Data can come from:
✔ CSV files
✔ APIs
✔ Databases
✔ Web scraping
🔹 3. Data Cleaning
Clean messy data:
✔ Handle missing values
✔ Remove duplicates
✔ Fix data types
✔ Handle outliers
Using:
Pandas
🔹 4. Exploratory Data Analysis (EDA)
Understand the dataset:
✔ Trends
✔ Patterns
✔ Correlations
✔ Distributions
Using:
Matplotlib & Seaborn
🔹 5. Feature Engineering ⭐
Create useful features for better prediction.
Examples:
✔ Extract month from date
✔ Convert categories into numbers
✔ Create new calculated columns
🔹 6. Split Data
Train Data → Learn patterns
Test Data → Evaluate model
Usually:
✔ 80% Training
✔ 20% Testing
🔥 7. Train Machine Learning Model
Choose algorithm:
✔ Linear Regression
✔ Random Forest
✔ SVM
✔ KNN
🔹 8. Evaluate Model
Check performance using:
✔ Accuracy
✔ Precision
✔ Recall
✔ RMSE
🔹 9. Hyperparameter Tuning
Improve model using:
✔ Grid Search
✔ Cross Validation
🔹 10. Deploy Model ⭐
Make model usable in real world.
Tools:
✔ Flask
✔ Streamlit
✔ FastAPI
🔹 11. Monitor Model
After deployment:
✔ Track performance
✔ Retrain if needed
🔥 12. Real-World Workflow Summary
Problem → Data → Cleaning → EDA →
Feature Engineering → Model →
Evaluation → Deployment
🎯 Today’s Goal
✔ Understand full ML lifecycle
✔ Learn project workflow
✔ Understand deployment basics
💬 Tap ❤️ for more!
👉 Today you’ll learn how real-world ML projects are built from start to finish.
This is one of the most important topics for interviews and projects.
🔹 1. Problem Understanding
👉 First understand the business problem.
Example:
✔ Predict house prices
✔ Detect spam emails
✔ Customer churn prediction
🔥 2. Collect Data
Data can come from:
✔ CSV files
✔ APIs
✔ Databases
✔ Web scraping
🔹 3. Data Cleaning
Clean messy data:
✔ Handle missing values
✔ Remove duplicates
✔ Fix data types
✔ Handle outliers
Using:
Pandas
🔹 4. Exploratory Data Analysis (EDA)
Understand the dataset:
✔ Trends
✔ Patterns
✔ Correlations
✔ Distributions
Using:
Matplotlib & Seaborn
🔹 5. Feature Engineering ⭐
Create useful features for better prediction.
Examples:
✔ Extract month from date
✔ Convert categories into numbers
✔ Create new calculated columns
🔹 6. Split Data
Train Data → Learn patterns
Test Data → Evaluate model
Usually:
✔ 80% Training
✔ 20% Testing
🔥 7. Train Machine Learning Model
Choose algorithm:
✔ Linear Regression
✔ Random Forest
✔ SVM
✔ KNN
🔹 8. Evaluate Model
Check performance using:
✔ Accuracy
✔ Precision
✔ Recall
✔ RMSE
🔹 9. Hyperparameter Tuning
Improve model using:
✔ Grid Search
✔ Cross Validation
🔹 10. Deploy Model ⭐
Make model usable in real world.
Tools:
✔ Flask
✔ Streamlit
✔ FastAPI
🔹 11. Monitor Model
After deployment:
✔ Track performance
✔ Retrain if needed
🔥 12. Real-World Workflow Summary
Problem → Data → Cleaning → EDA →
Feature Engineering → Model →
Evaluation → Deployment
🎯 Today’s Goal
✔ Understand full ML lifecycle
✔ Learn project workflow
✔ Understand deployment basics
💬 Tap ❤️ for more!
❤20👍1
✅ SQL for Data Science 🗄️📊
👉 SQL is one of the most important skills for Data Scientists and Data Analysts.
Almost every company stores data inside databases, and SQL helps retrieve and analyze that data.
🔹 1. What is SQL?
SQL = Structured Query Language
👉 Used to:
✔ Store data
✔ Retrieve data
✔ Filter data
✔ Analyze data
🔥 2. Common Database Systems
✔ MySQL
✔ PostgreSQL
✔ SQLite
✔ Microsoft SQL Server
🔹 3. Basic SQL Query
✅ SELECT Statement
Used to retrieve data from a table.
SELECT * FROM employees;
👉 ** means all columns.
🔹 4. Select Specific Columns
SELECT name, salary FROM employees;
🔹 5. WHERE Clause ⭐
Used for filtering data.
SELECT * FROM employees
WHERE salary > 50000;
🔹 6. ORDER BY
Sort data.
SELECT * FROM employees
ORDER BY salary DESC;
✔ ASC → Ascending
✔ DESC → Descending
🔹 7. Aggregate Functions ⭐
Used for calculations.
Function: COUNT()
Purpose: Count rows
Function: SUM()
Purpose: Total
Function: AVG()
Purpose: Average
Function: MAX()
Purpose: Highest value
Function: MIN()
Purpose: Lowest value
✅ Example
SELECT AVG(salary)
FROM employees;
🔹 8. GROUP BY ⭐
Used to group data.
SELECT department, AVG(salary)
FROM employees
GROUP BY department;
🔹 9. Why SQL is Important?
✔ Most asked interview skill
✔ Used daily by analysts & data scientists
✔ Essential for working with databases
🎯 Today’s Goal
✔ Learn SELECT queries
✔ Filter using WHERE
✔ Use aggregate functions
✔ Understand GROUP BY
👉 SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v 🗄️🔥
💬 Tap ❤️ for more!
👉 SQL is one of the most important skills for Data Scientists and Data Analysts.
Almost every company stores data inside databases, and SQL helps retrieve and analyze that data.
🔹 1. What is SQL?
SQL = Structured Query Language
👉 Used to:
✔ Store data
✔ Retrieve data
✔ Filter data
✔ Analyze data
🔥 2. Common Database Systems
✔ MySQL
✔ PostgreSQL
✔ SQLite
✔ Microsoft SQL Server
🔹 3. Basic SQL Query
✅ SELECT Statement
Used to retrieve data from a table.
SELECT * FROM employees;
👉 ** means all columns.
🔹 4. Select Specific Columns
SELECT name, salary FROM employees;
🔹 5. WHERE Clause ⭐
Used for filtering data.
SELECT * FROM employees
WHERE salary > 50000;
🔹 6. ORDER BY
Sort data.
SELECT * FROM employees
ORDER BY salary DESC;
✔ ASC → Ascending
✔ DESC → Descending
🔹 7. Aggregate Functions ⭐
Used for calculations.
Function: COUNT()
Purpose: Count rows
Function: SUM()
Purpose: Total
Function: AVG()
Purpose: Average
Function: MAX()
Purpose: Highest value
Function: MIN()
Purpose: Lowest value
✅ Example
SELECT AVG(salary)
FROM employees;
🔹 8. GROUP BY ⭐
Used to group data.
SELECT department, AVG(salary)
FROM employees
GROUP BY department;
🔹 9. Why SQL is Important?
✔ Most asked interview skill
✔ Used daily by analysts & data scientists
✔ Essential for working with databases
🎯 Today’s Goal
✔ Learn SELECT queries
✔ Filter using WHERE
✔ Use aggregate functions
✔ Understand GROUP BY
👉 SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v 🗄️🔥
💬 Tap ❤️ for more!
❤16👍1
✅ SQL JOINS 🗄️🔗
👉 SQL JOINS are used to combine data from multiple tables.
🔹 1. Why JOINS are Needed?
In real databases, data is stored in different tables.
Example:
Employees Table
emp_id: 1
name: Rahul
Salary Table
emp_id: 1
salary: 50000
👉 To combine employee name with salary → use JOIN.
🔥 2. INNER JOIN ⭐
Returns only matching rows from both tables.
✔ Most commonly used JOIN.
🔹 3. LEFT JOIN
Returns:
✔ All rows from left table
✔ Matching rows from right table
👉 Non-matching rows return NULL.
🔹 4. RIGHT JOIN
Returns:
✔ All rows from right table
✔ Matching rows from left table
🔹 5. FULL JOIN
Returns all rows from both tables.
🔹 6. SELF JOIN ⭐
Joining a table with itself.
Used for:
✔ Employee-manager relationships
🔹 7. Visual Understanding
• INNER JOIN → Matching only
• LEFT JOIN → All left + matching right
• RIGHT JOIN → All right + matching left
• FULL JOIN → Everything
🔹 8. Why JOINS are Important?
✔ Used daily in real projects
✔ Most asked interview topic
✔ Combines business data from multiple tables
🎯 Today’s Goal
✔ Understand INNER JOIN
✔ Learn LEFT/RIGHT/FULL JOIN
✔ Understand real-world use cases
SQL Notes: https://whatsapp.com/channel/0029VbCyzS02ZjCwoShXXc2j
💬 Tap ❤️ for more!
👉 SQL JOINS are used to combine data from multiple tables.
🔹 1. Why JOINS are Needed?
In real databases, data is stored in different tables.
Example:
Employees Table
emp_id: 1
name: Rahul
Salary Table
emp_id: 1
salary: 50000
👉 To combine employee name with salary → use JOIN.
🔥 2. INNER JOIN ⭐
Returns only matching rows from both tables.
SELECT employees.name, salary.salary
FROM employees
INNER JOIN salary
ON employees.emp_id = salary.emp_id;
✔ Most commonly used JOIN.
🔹 3. LEFT JOIN
Returns:
✔ All rows from left table
✔ Matching rows from right table
SELECT *
FROM employees
LEFT JOIN salary
ON employees.emp_id = salary.emp_id;
👉 Non-matching rows return NULL.
🔹 4. RIGHT JOIN
Returns:
✔ All rows from right table
✔ Matching rows from left table
SELECT *
FROM employees
RIGHT JOIN salary
ON employees.emp_id = salary.emp_id;
🔹 5. FULL JOIN
Returns all rows from both tables.
SELECT *
FROM employees
FULL OUTER JOIN salary
ON employees.emp_id = salary.emp_id;
🔹 6. SELF JOIN ⭐
Joining a table with itself.
Used for:
✔ Employee-manager relationships
🔹 7. Visual Understanding
• INNER JOIN → Matching only
• LEFT JOIN → All left + matching right
• RIGHT JOIN → All right + matching left
• FULL JOIN → Everything
🔹 8. Why JOINS are Important?
✔ Used daily in real projects
✔ Most asked interview topic
✔ Combines business data from multiple tables
🎯 Today’s Goal
✔ Understand INNER JOIN
✔ Learn LEFT/RIGHT/FULL JOIN
✔ Understand real-world use cases
SQL Notes: https://whatsapp.com/channel/0029VbCyzS02ZjCwoShXXc2j
💬 Tap ❤️ for more!
❤11👍1
DATA ANALYST Interview Questions (0-3 yr) (SQL, Power BI)
👉 Power BI:
Q1: Explain step-by-step how you will create a sales dashboard from scratch.
Q2: Explain how you can optimize a slow Power BI report.
Q3: Explain Any 5 Chart Types and Their Uses in Representing Different Aspects of Data.
👉SQL:
Q1: Explain the difference between RANK(), DENSE_RANK(), and ROW_NUMBER() functions using example.
Q2 – Q4 use Table: employee (EmpID, ManagerID, JoinDate, Dept, Salary)
Q2: Find the nth highest salary from the Employee table.
Q3: You have an employee table with employee ID and manager ID. Find all employees under a specific manager, including their subordinates at any level.
Q4: Write a query to find the cumulative salary of employees department-wise, who have joined the company in the last 30 days.
Q5: Find the top 2 customers with the highest order amount for each product category, handling ties appropriately. Table: Customer (CustomerID, ProductCategory, OrderAmount)
👉Behavioral:
Q1: Why do you want to become a data analyst and why did you apply to this company?
Q2: Describe a time when you had to manage a difficult task with tight deadlines. How did you handle it?
I have curated best top-notch Data Analytics Resources 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope this helps you 😊
👉 Power BI:
Q1: Explain step-by-step how you will create a sales dashboard from scratch.
Q2: Explain how you can optimize a slow Power BI report.
Q3: Explain Any 5 Chart Types and Their Uses in Representing Different Aspects of Data.
👉SQL:
Q1: Explain the difference between RANK(), DENSE_RANK(), and ROW_NUMBER() functions using example.
Q2 – Q4 use Table: employee (EmpID, ManagerID, JoinDate, Dept, Salary)
Q2: Find the nth highest salary from the Employee table.
Q3: You have an employee table with employee ID and manager ID. Find all employees under a specific manager, including their subordinates at any level.
Q4: Write a query to find the cumulative salary of employees department-wise, who have joined the company in the last 30 days.
Q5: Find the top 2 customers with the highest order amount for each product category, handling ties appropriately. Table: Customer (CustomerID, ProductCategory, OrderAmount)
👉Behavioral:
Q1: Why do you want to become a data analyst and why did you apply to this company?
Q2: Describe a time when you had to manage a difficult task with tight deadlines. How did you handle it?
I have curated best top-notch Data Analytics Resources 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope this helps you 😊
❤8👍1🤩1
A-Z of essential data science concepts
A: Algorithm - A set of rules or instructions for solving a problem or completing a task.
B: Big Data - Large and complex datasets that traditional data processing applications are unable to handle efficiently.
C: Classification - A type of machine learning task that involves assigning labels to instances based on their characteristics.
D: Data Mining - The process of discovering patterns and extracting useful information from large datasets.
E: Ensemble Learning - A machine learning technique that combines multiple models to improve predictive performance.
F: Feature Engineering - The process of selecting, extracting, and transforming features from raw data to improve model performance.
G: Gradient Descent - An optimization algorithm used to minimize the error of a model by adjusting its parameters iteratively.
H: Hypothesis Testing - A statistical method used to make inferences about a population based on sample data.
I: Imputation - The process of replacing missing values in a dataset with estimated values.
J: Joint Probability - The probability of the intersection of two or more events occurring simultaneously.
K: K-Means Clustering - A popular unsupervised machine learning algorithm used for clustering data points into groups.
L: Logistic Regression - A statistical model used for binary classification tasks.
M: Machine Learning - A subset of artificial intelligence that enables systems to learn from data and improve performance over time.
N: Neural Network - A computer system inspired by the structure of the human brain, used for various machine learning tasks.
O: Outlier Detection - The process of identifying observations in a dataset that significantly deviate from the rest of the data points.
P: Precision and Recall - Evaluation metrics used to assess the performance of classification models.
Q: Quantitative Analysis - The process of using mathematical and statistical methods to analyze and interpret data.
R: Regression Analysis - A statistical technique used to model the relationship between a dependent variable and one or more independent variables.
S: Support Vector Machine - A supervised machine learning algorithm used for classification and regression tasks.
T: Time Series Analysis - The study of data collected over time to detect patterns, trends, and seasonal variations.
U: Unsupervised Learning - Machine learning techniques used to identify patterns and relationships in data without labeled outcomes.
V: Validation - The process of assessing the performance and generalization of a machine learning model using independent datasets.
W: Weka - A popular open-source software tool used for data mining and machine learning tasks.
X: XGBoost - An optimized implementation of gradient boosting that is widely used for classification and regression tasks.
Y: Yarn - A resource manager used in Apache Hadoop for managing resources across distributed clusters.
Z: Zero-Inflated Model - A statistical model used to analyze data with excess zeros, commonly found in count data.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
Credits: https://xn--r1a.website/datasciencefun
Like if you need similar content 😄👍
Hope this helps you 😊
A: Algorithm - A set of rules or instructions for solving a problem or completing a task.
B: Big Data - Large and complex datasets that traditional data processing applications are unable to handle efficiently.
C: Classification - A type of machine learning task that involves assigning labels to instances based on their characteristics.
D: Data Mining - The process of discovering patterns and extracting useful information from large datasets.
E: Ensemble Learning - A machine learning technique that combines multiple models to improve predictive performance.
F: Feature Engineering - The process of selecting, extracting, and transforming features from raw data to improve model performance.
G: Gradient Descent - An optimization algorithm used to minimize the error of a model by adjusting its parameters iteratively.
H: Hypothesis Testing - A statistical method used to make inferences about a population based on sample data.
I: Imputation - The process of replacing missing values in a dataset with estimated values.
J: Joint Probability - The probability of the intersection of two or more events occurring simultaneously.
K: K-Means Clustering - A popular unsupervised machine learning algorithm used for clustering data points into groups.
L: Logistic Regression - A statistical model used for binary classification tasks.
M: Machine Learning - A subset of artificial intelligence that enables systems to learn from data and improve performance over time.
N: Neural Network - A computer system inspired by the structure of the human brain, used for various machine learning tasks.
O: Outlier Detection - The process of identifying observations in a dataset that significantly deviate from the rest of the data points.
P: Precision and Recall - Evaluation metrics used to assess the performance of classification models.
Q: Quantitative Analysis - The process of using mathematical and statistical methods to analyze and interpret data.
R: Regression Analysis - A statistical technique used to model the relationship between a dependent variable and one or more independent variables.
S: Support Vector Machine - A supervised machine learning algorithm used for classification and regression tasks.
T: Time Series Analysis - The study of data collected over time to detect patterns, trends, and seasonal variations.
U: Unsupervised Learning - Machine learning techniques used to identify patterns and relationships in data without labeled outcomes.
V: Validation - The process of assessing the performance and generalization of a machine learning model using independent datasets.
W: Weka - A popular open-source software tool used for data mining and machine learning tasks.
X: XGBoost - An optimized implementation of gradient boosting that is widely used for classification and regression tasks.
Y: Yarn - A resource manager used in Apache Hadoop for managing resources across distributed clusters.
Z: Zero-Inflated Model - A statistical model used to analyze data with excess zeros, commonly found in count data.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
Credits: https://xn--r1a.website/datasciencefun
Like if you need similar content 😄👍
Hope this helps you 😊
❤12👍1🥰1😁1
🚀 𝗧𝗖𝗦 𝗙𝗥𝗘𝗘 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝟮𝟬𝟮𝟲 – 𝗘𝗻𝗿𝗼𝗹𝗹 𝗡𝗼𝘄!
TCS iON is offering FREE certification courses to help students, freshers & professionals build job-ready skills from home 🌍
✅ 100% Free Online Courses
✅ Free Verified Certificates
✅ Self-Paced Learning
✅ Beginner-Friendly Programs
✅ Learn from TCS Industry Experts
🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:
https://pdlink.in/4nTGSDh
🔥 Excellent opportunity to gain valuable certifications from one of India’s top IT companies completely FREE.
TCS iON is offering FREE certification courses to help students, freshers & professionals build job-ready skills from home 🌍
✅ 100% Free Online Courses
✅ Free Verified Certificates
✅ Self-Paced Learning
✅ Beginner-Friendly Programs
✅ Learn from TCS Industry Experts
🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:
https://pdlink.in/4nTGSDh
🔥 Excellent opportunity to gain valuable certifications from one of India’s top IT companies completely FREE.
❤5
✅ Advanced SQL (Subqueries & CTEs) 🗄️🔥
👉 Now we move to advanced SQL concepts heavily used in:
✔ Data Analysis
✔ Reporting
✔ Dashboards
✔ Interviews
🔹 1. What is a Subquery?
A subquery is a query written inside another query.
👉 Also called:
✅ Nested Query
🔥 2. Example of Subquery
👉 Find employees earning above average salary.
SELECT name, salary
FROM employees
WHERE salary > (
SELECT AVG(salary)
FROM employees
);
How it works:
1️⃣ Inner query calculates average salary
2️⃣ Outer query filters employees
🔹 3. Types of Subqueries
✔ Single-row subquery
✔ Multiple-row subquery
✔ Correlated subquery
🔹 4. Correlated Subquery ⭐
👉 Inner query depends on outer query.
SELECT e1.name
FROM employees e1
WHERE salary > (
SELECT AVG(salary)
FROM employees e2
WHERE e1.department = e2.department
);
🔥 5. What is a CTE?
CTE = Common Table Expression
👉 Temporary result set used inside a query.
Defined using:
WITH
🔹 6. Example of CTE ⭐
WITH avg_salary AS (
SELECT AVG(salary) AS avg_sal
FROM employees
)
SELECT *
FROM employees
WHERE salary > (
SELECT avg_sal FROM avg_salary
);
🔹 7. Why Use CTEs?
✔ Makes queries readable
✔ Simplifies complex logic
✔ Easier debugging
🔹 8. Difference Between Subquery & CTE
Subquery : Nested inside query
CTE : Defined separately
Subquery : Harder to read
CTE : More readable
Subquery : Repeated logic possible
CTE : Reusable
🔹 9. Why This is Important?
✔ Frequently asked in interviews
✔ Used in dashboards & analytics
✔ Important for real-world SQL projects
🎯 Today’s Goal
✔ Understand subqueries
✔ Learn correlated subqueries
✔ Understand CTEs
✔ Write cleaner SQL queries
👉 SQL Notes: https://whatsapp.com/channel/0029VbCyzS02ZjCwoShXXc2j
💬 Tap ❤️ for more!
👉 Now we move to advanced SQL concepts heavily used in:
✔ Data Analysis
✔ Reporting
✔ Dashboards
✔ Interviews
🔹 1. What is a Subquery?
A subquery is a query written inside another query.
👉 Also called:
✅ Nested Query
🔥 2. Example of Subquery
👉 Find employees earning above average salary.
SELECT name, salary
FROM employees
WHERE salary > (
SELECT AVG(salary)
FROM employees
);
How it works:
1️⃣ Inner query calculates average salary
2️⃣ Outer query filters employees
🔹 3. Types of Subqueries
✔ Single-row subquery
✔ Multiple-row subquery
✔ Correlated subquery
🔹 4. Correlated Subquery ⭐
👉 Inner query depends on outer query.
SELECT e1.name
FROM employees e1
WHERE salary > (
SELECT AVG(salary)
FROM employees e2
WHERE e1.department = e2.department
);
🔥 5. What is a CTE?
CTE = Common Table Expression
👉 Temporary result set used inside a query.
Defined using:
WITH
🔹 6. Example of CTE ⭐
WITH avg_salary AS (
SELECT AVG(salary) AS avg_sal
FROM employees
)
SELECT *
FROM employees
WHERE salary > (
SELECT avg_sal FROM avg_salary
);
🔹 7. Why Use CTEs?
✔ Makes queries readable
✔ Simplifies complex logic
✔ Easier debugging
🔹 8. Difference Between Subquery & CTE
Subquery : Nested inside query
CTE : Defined separately
Subquery : Harder to read
CTE : More readable
Subquery : Repeated logic possible
CTE : Reusable
🔹 9. Why This is Important?
✔ Frequently asked in interviews
✔ Used in dashboards & analytics
✔ Important for real-world SQL projects
🎯 Today’s Goal
✔ Understand subqueries
✔ Learn correlated subqueries
✔ Understand CTEs
✔ Write cleaner SQL queries
👉 SQL Notes: https://whatsapp.com/channel/0029VbCyzS02ZjCwoShXXc2j
💬 Tap ❤️ for more!
❤12
🚀 𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 | 𝗚𝗲𝘁 𝗛𝗶𝗿𝗲𝗱 𝗶𝗻 𝗧𝗼𝗽 𝗧𝗲𝗰𝗵 𝗖𝗼𝗺𝗽𝗮𝗻𝗶𝗲𝘀! 💼🔥
Master the most in-demand tech skills and kickstart your career with industry-leading training.
🎯 Program Highlights:
✅ Learn Coding from Industry Experts
✅ Real-World Projects & Interview Preparation
✅ Dedicated Placement Support
✅ Avg. Package: ₹7.2 LPA
✅ Highest Package: ₹41 LPA 🚀
🎓 Perfect for Freshers, Students & Career Switchers
𝐑𝐞𝐠𝐢𝐬𝐭𝐞𝐫 𝐍𝐨𝐰 👇:-
https://pdlink.in/42WOE5H
Hurry! Limited seats are available.🏃♂️
Master the most in-demand tech skills and kickstart your career with industry-leading training.
🎯 Program Highlights:
✅ Learn Coding from Industry Experts
✅ Real-World Projects & Interview Preparation
✅ Dedicated Placement Support
✅ Avg. Package: ₹7.2 LPA
✅ Highest Package: ₹41 LPA 🚀
🎓 Perfect for Freshers, Students & Career Switchers
𝐑𝐞𝐠𝐢𝐬𝐭𝐞𝐫 𝐍𝐨𝐰 👇:-
https://pdlink.in/42WOE5H
Hurry! Limited seats are available.🏃♂️
❤1😢1