Which of the following join is not available in SQL?
Anonymous Quiz
4%
INNER JOIN
20%
CROSS JOIN
57%
UPPER JOIN
19%
SELF JOIN
π2
Data Analytics
SQL Interview Questions with detailed answers: 6οΈβ£ How do you find the second highest salary from an Employee table? There are multiple ways to find the second highest salary in SQL. Here are three common approaches: 1οΈβ£ Using LIMIT and OFFSET (MySQL,β¦
SQL Interview Questions with detailed answers:
7οΈβ£ What is a Common Table Expression (CTE), and when should you use it?
A Common Table Expression (CTE) is a temporary result set that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement. It improves code readability and allows recursive queries.
Syntax of a CTE
Example: Using CTE to Find Employees with High Salaries
When to Use CTEs?
1οΈβ£ Improve Readability β Makes complex queries easier to understand.
2οΈβ£ Avoid Subquery Repetition β Instead of repeating subqueries, define them once in a CTE.
3οΈβ£ Enable Recursion β Useful for hierarchical data like employee-manager relationships.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
7οΈβ£ What is a Common Table Expression (CTE), and when should you use it?
A Common Table Expression (CTE) is a temporary result set that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement. It improves code readability and allows recursive queries.
Syntax of a CTE
WITH cte_name AS ( SELECT column1, column2 FROM table_name WHERE condition ) SELECT * FROM cte_name;
Example: Using CTE to Find Employees with High Salaries
WITH HighSalaryEmployees AS ( SELECT employee_id, first_name, salary FROM employees WHERE salary > 70000 ) SELECT * FROM HighSalaryEmployees;
When to Use CTEs?
1οΈβ£ Improve Readability β Makes complex queries easier to understand.
2οΈβ£ Avoid Subquery Repetition β Instead of repeating subqueries, define them once in a CTE.
3οΈβ£ Enable Recursion β Useful for hierarchical data like employee-manager relationships.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π21β€17π1
Which of the following is not an aggregate function in SQL?
Anonymous Quiz
11%
SUM()
16%
MIN()
67%
MEAN()
6%
AVG()
π19π₯°1π1
Data Analytics
SQL Interview Questions with detailed answers: 7οΈβ£ What is a Common Table Expression (CTE), and when should you use it? A Common Table Expression (CTE) is a temporary result set that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement.β¦
SQL Interview Questions with detailed answers:
8οΈβ£ How do you identify missing values in a dataset using SQL?
In SQL, missing values are usually represented as NULL. You can detect them using the IS NULL condition.
Basic Query to Find NULL Values in a Column
This retrieves all employees where the salary is missing.
Find Missing Values in Multiple Columns
This checks for NULL values in both the salary and department_id columns.
Count Missing Values in Each Column
Since COUNT(column_name) ignores NULL values, subtracting it from COUNT(*) gives the number of missing values.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
8οΈβ£ How do you identify missing values in a dataset using SQL?
In SQL, missing values are usually represented as NULL. You can detect them using the IS NULL condition.
Basic Query to Find NULL Values in a Column
SELECT * FROM employees WHERE salary IS NULL;
This retrieves all employees where the salary is missing.
Find Missing Values in Multiple Columns
SELECT * FROM employees WHERE salary IS NULL OR department_id IS NULL;
This checks for NULL values in both the salary and department_id columns.
Count Missing Values in Each Column
SELECT COUNT(*) AS total_rows, COUNT(salary) AS non_null_salaries, COUNT(department_id) AS non_null_departments FROM employees;
Since COUNT(column_name) ignores NULL values, subtracting it from COUNT(*) gives the number of missing values.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
β€21π14
Which of the following python library is used for data visualization?
Anonymous Quiz
76%
Matplotlib
18%
Numpy
2%
Keras
3%
Flask
π2
Data Analytics
Which of the following python library is used for data visualization?
Here are some most popular Python libraries for data visualization:
Matplotlib β The most fundamental library for static charts. Best for basic visualizations like line, bar, and scatter plots. Highly customizable but requires more coding.
Seaborn β Built on Matplotlib, it simplifies statistical data visualization with beautiful defaults. Ideal for correlation heatmaps, categorical plots, and distribution analysis.
Plotly β Best for interactive visualizations with zooming, hovering, and real-time updates. Great for dashboards, web applications, and 3D plotting.
Bokeh β Designed for interactive and web-based visualizations. Excellent for handling large datasets, streaming data, and integrating with Flask/Django.
Altair β A declarative library that makes complex statistical plots easy with minimal code. Best for quick and clean data exploration.
For static charts, start with Matplotlib or Seaborn. If you need interactivity, use Plotly or Bokeh. For quick EDA, Altair is a great choice.
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#python
Matplotlib β The most fundamental library for static charts. Best for basic visualizations like line, bar, and scatter plots. Highly customizable but requires more coding.
Seaborn β Built on Matplotlib, it simplifies statistical data visualization with beautiful defaults. Ideal for correlation heatmaps, categorical plots, and distribution analysis.
Plotly β Best for interactive visualizations with zooming, hovering, and real-time updates. Great for dashboards, web applications, and 3D plotting.
Bokeh β Designed for interactive and web-based visualizations. Excellent for handling large datasets, streaming data, and integrating with Flask/Django.
Altair β A declarative library that makes complex statistical plots easy with minimal code. Best for quick and clean data exploration.
For static charts, start with Matplotlib or Seaborn. If you need interactivity, use Plotly or Bokeh. For quick EDA, Altair is a great choice.
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#python
β€8π8
Data Analytics
SQL Interview Questions with detailed answers: 8οΈβ£ How do you identify missing values in a dataset using SQL? In SQL, missing values are usually represented as NULL. You can detect them using the IS NULL condition. Basic Query to Find NULL Values in aβ¦
SQL Interview Questions with detailed answers:
9οΈβ£ What is the difference between UNION and UNION ALL?
Both UNION and UNION ALL are used to combine the results of two or more SELECT queries, but they handle duplicate records differently.
1οΈβ£ UNION (Removes Duplicates)
Combines result sets and removes duplicate rows automatically.
It performs an implicit DISTINCT operation, which may affect performance.
2οΈβ£ UNION ALL (Keeps Duplicates)
Combines result sets without removing duplicates.
Faster than UNION because it doesnβt perform duplicate elimination.
Key Differences:
UNION removes duplicates, which may cause performance overhead.
UNION ALL keeps all records, making it more efficient.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
9οΈβ£ What is the difference between UNION and UNION ALL?
Both UNION and UNION ALL are used to combine the results of two or more SELECT queries, but they handle duplicate records differently.
1οΈβ£ UNION (Removes Duplicates)
Combines result sets and removes duplicate rows automatically.
It performs an implicit DISTINCT operation, which may affect performance.
SELECT employee_id, department_id FROM employees UNION SELECT employee_id, department_id FROM managers;
2οΈβ£ UNION ALL (Keeps Duplicates)
Combines result sets without removing duplicates.
Faster than UNION because it doesnβt perform duplicate elimination.
SELECT employee_id, department_id FROM employees UNION ALL SELECT employee_id, department_id FROM managers;
Key Differences:
UNION removes duplicates, which may cause performance overhead.
UNION ALL keeps all records, making it more efficient.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π17β€13
β€8π₯°4
Many people pay too much to learn Excel, but my mission is to break down barriers. I have shared complete learning series to learn Excel from scratch.
Here are the links to the Excel series
Complete Excel Topics for Data Analyst: https://t.iss.one/sqlspecialist/547
Part-1: https://t.iss.one/sqlspecialist/617
Part-2: https://t.iss.one/sqlspecialist/620
Part-3: https://t.iss.one/sqlspecialist/623
Part-4: https://t.iss.one/sqlspecialist/624
Part-5: https://t.iss.one/sqlspecialist/628
Part-6: https://t.iss.one/sqlspecialist/633
Part-7: https://t.iss.one/sqlspecialist/634
Part-8: https://t.iss.one/sqlspecialist/635
Part-9: https://t.iss.one/sqlspecialist/640
Part-10: https://t.iss.one/sqlspecialist/641
Part-11: https://t.iss.one/sqlspecialist/644
Part-12:
https://t.iss.one/sqlspecialist/646
Part-13: https://t.iss.one/sqlspecialist/650
Part-14: https://t.iss.one/sqlspecialist/651
Part-15: https://t.iss.one/sqlspecialist/654
Part-16: https://t.iss.one/sqlspecialist/655
Part-17: https://t.iss.one/sqlspecialist/658
Part-18: https://t.iss.one/sqlspecialist/660
Part-19: https://t.iss.one/sqlspecialist/661
Part-20: https://t.iss.one/sqlspecialist/662
Bonus: https://t.iss.one/sqlspecialist/663
I saw a lot of big influencers copy pasting my content after removing the credits. It's absolutely fine for me as more people are getting free education because of my content.
But I will really appreciate if you share credits for the time and efforts I put in to create such valuable content. I hope you can understand.
You can join this telegram channel for more Excel Resources: https://t.iss.one/excel_data
Python Learning Series: https://t.iss.one/sqlspecialist/615
Complete SQL Topics for Data Analysts: https://t.iss.one/sqlspecialist/523
Complete Power BI Topics for Data Analysts: https://t.iss.one/sqlspecialist/588
I'll now start with learning series on SQL Interviews & Tableau.
Thanks to all who support our channel and share the content with proper credits. You guys are really amazing.
Hope it helps :)
Here are the links to the Excel series
Complete Excel Topics for Data Analyst: https://t.iss.one/sqlspecialist/547
Part-1: https://t.iss.one/sqlspecialist/617
Part-2: https://t.iss.one/sqlspecialist/620
Part-3: https://t.iss.one/sqlspecialist/623
Part-4: https://t.iss.one/sqlspecialist/624
Part-5: https://t.iss.one/sqlspecialist/628
Part-6: https://t.iss.one/sqlspecialist/633
Part-7: https://t.iss.one/sqlspecialist/634
Part-8: https://t.iss.one/sqlspecialist/635
Part-9: https://t.iss.one/sqlspecialist/640
Part-10: https://t.iss.one/sqlspecialist/641
Part-11: https://t.iss.one/sqlspecialist/644
Part-12:
https://t.iss.one/sqlspecialist/646
Part-13: https://t.iss.one/sqlspecialist/650
Part-14: https://t.iss.one/sqlspecialist/651
Part-15: https://t.iss.one/sqlspecialist/654
Part-16: https://t.iss.one/sqlspecialist/655
Part-17: https://t.iss.one/sqlspecialist/658
Part-18: https://t.iss.one/sqlspecialist/660
Part-19: https://t.iss.one/sqlspecialist/661
Part-20: https://t.iss.one/sqlspecialist/662
Bonus: https://t.iss.one/sqlspecialist/663
I saw a lot of big influencers copy pasting my content after removing the credits. It's absolutely fine for me as more people are getting free education because of my content.
But I will really appreciate if you share credits for the time and efforts I put in to create such valuable content. I hope you can understand.
You can join this telegram channel for more Excel Resources: https://t.iss.one/excel_data
Python Learning Series: https://t.iss.one/sqlspecialist/615
Complete SQL Topics for Data Analysts: https://t.iss.one/sqlspecialist/523
Complete Power BI Topics for Data Analysts: https://t.iss.one/sqlspecialist/588
I'll now start with learning series on SQL Interviews & Tableau.
Thanks to all who support our channel and share the content with proper credits. You guys are really amazing.
Hope it helps :)
β€30π13π₯°4π2π1
Data Analytics
SQL Interview Questions with detailed answers: 9οΈβ£ What is the difference between UNION and UNION ALL? Both UNION and UNION ALL are used to combine the results of two or more SELECT queries, but they handle duplicate records differently. 1οΈβ£ UNION (Removesβ¦
SQL Interview Questions with detailed answers:
π How do you calculate a running total in SQL?
A running total (also known as a cumulative sum) is the sum of values up to the current row. You can calculate it using window functions like SUM() OVER().
Using SUM() with OVER() (Best Approach)
Explanation:
SUM(salary) OVER (ORDER BY employee_id) calculates a cumulative sum.
The ORDER BY employee_id ensures the total is calculated sequentially.
Running Total Partitioned by a Category
To calculate the running total within groups (e.g., per department): π
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π How do you calculate a running total in SQL?
A running total (also known as a cumulative sum) is the sum of values up to the current row. You can calculate it using window functions like SUM() OVER().
Using SUM() with OVER() (Best Approach)
SELECT employee_id, salary, SUM(salary) OVER (ORDER BY employee_id) AS running_total FROM employees;
Explanation:
SUM(salary) OVER (ORDER BY employee_id) calculates a cumulative sum.
The ORDER BY employee_id ensures the total is calculated sequentially.
Running Total Partitioned by a Category
To calculate the running total within groups (e.g., per department): π
SELECT department_id, employee_id, salary, SUM(salary) OVER (PARTITION BY department_id ORDER BY employee_id) AS running_total FROM employees;
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π25β€1π1π1
Which of the following aggregate function is used to calculate mean in SQL?
Anonymous Quiz
13%
SUM()
52%
MEAN()
3%
MIN()
32%
AVG()
π13β€8π₯1π₯°1π1
If you want to Excel at using the most used database language in the world, learn these powerful SQL features:
β’ Wildcards (%, _) β Flexible pattern matching
β’ Window Functions β ROW_NUMBER(), RANK(), DENSE_RANK(), LEAD(), LAG()
β’ Common Table Expressions (CTEs) β WITH for better readability
β’ Recursive Queries β Handle hierarchical data
β’ STRING Functions β LEFT(), RIGHT(), LEN(), TRIM(), UPPER(), LOWER()
β’ Date Functions β DATEDIFF(), DATEADD(), FORMAT()
β’ Pivot & Unpivot β Transform row data into columns
β’ Aggregate Functions β SUM(), AVG(), COUNT(), MIN(), MAX()
β’ Joins & Self Joins β Master INNER, LEFT, RIGHT, FULL, SELF JOIN
β’ Indexing β Speed up queries with CREATE INDEX
Like it if you need a complete tutorial on all these topics! πβ€οΈ
#sql
β’ Wildcards (%, _) β Flexible pattern matching
β’ Window Functions β ROW_NUMBER(), RANK(), DENSE_RANK(), LEAD(), LAG()
β’ Common Table Expressions (CTEs) β WITH for better readability
β’ Recursive Queries β Handle hierarchical data
β’ STRING Functions β LEFT(), RIGHT(), LEN(), TRIM(), UPPER(), LOWER()
β’ Date Functions β DATEDIFF(), DATEADD(), FORMAT()
β’ Pivot & Unpivot β Transform row data into columns
β’ Aggregate Functions β SUM(), AVG(), COUNT(), MIN(), MAX()
β’ Joins & Self Joins β Master INNER, LEFT, RIGHT, FULL, SELF JOIN
β’ Indexing β Speed up queries with CREATE INDEX
Like it if you need a complete tutorial on all these topics! πβ€οΈ
#sql
π29β€13π1
Changed the channel name from "Data Analysts" to "Data Analytics" as moving further I've decided to also teach Data Science, AI, and the latest industry trends to help you stay ahead!
If you support this change, react with a like β€οΈ
If you support this change, react with a like β€οΈ
β€113π28π3π₯2
Data Analytics
SQL Interview Questions with detailed answers: π How do you calculate a running total in SQL? A running total (also known as a cumulative sum) is the sum of values up to the current row. You can calculate it using window functions like SUM() OVER(). Usingβ¦
SQL Interview Questions with detailed answers:
1οΈβ£1οΈβ£ How does a self-join work? Give an example.
A self-join is when a table joins with itself. It is useful for comparing rows within the same table, such as finding employees and their managers.
Example:
Find Employee-Manager Relationships
Explanation:
e1 represents employees.
e2 represents managers.
The join condition e1.manager_id = e2.employee_id matches employees to their managers.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
1οΈβ£1οΈβ£ How does a self-join work? Give an example.
A self-join is when a table joins with itself. It is useful for comparing rows within the same table, such as finding employees and their managers.
Example:
Find Employee-Manager Relationships
SELECT e1.employee_id AS Employee, e1.name AS Employee_Name, e2.employee_id AS Manager, e2.name AS Manager_Name FROM employees e1 JOIN employees e2 ON e1.manager_id = e2.employee_id;
Explanation:
e1 represents employees.
e2 represents managers.
The join condition e1.manager_id = e2.employee_id matches employees to their managers.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π17β€10
Which of the following window function is used to return the rank of each record in the current result set without skipping values if the preceding results are identical?
Anonymous Quiz
20%
ROW_NUNBER()
33%
RANK()
4%
LAG()
43%
DENSE_RANK()
π13β€6π3
If you want to Excel as a Data Analyst and land a high-paying job, master these essential skills:
1οΈβ£ Data Extraction & Processing:
β’ SQL β SELECT, JOIN, GROUP BY, CTE, WINDOW FUNCTIONS
β’ Python/R for Data Analysis β Pandas, NumPy, Matplotlib, Seaborn
β’ Excel β Pivot Tables, VLOOKUP, XLOOKUP, Power Query
2οΈβ£ Data Cleaning & Transformation:
β’ Handling Missing Data β COALESCE(), IFNULL(), DROPNA()
β’ Data Normalization β Removing duplicates, standardizing formats
β’ ETL Process β Extract, Transform, Load
3οΈβ£ Exploratory Data Analysis (EDA):
β’ Descriptive Statistics β Mean, Median, Mode, Variance, Standard Deviation
β’ Data Visualization β Bar Charts, Line Charts, Heatmaps, Histograms
4οΈβ£ Business Intelligence & Reporting:
β’ Power BI & Tableau β Dashboards, DAX, Filters, Drill-through
β’ Google Data Studio β Interactive reports
5οΈβ£ Data-Driven Decision Making:
β’ A/B Testing β Hypothesis testing, P-values
β’ Forecasting & Trend Analysis β Time Series Analysis
β’ KPI & Metrics Analysis β ROI, Churn Rate, Customer Segmentation
6οΈβ£ Data Storytelling & Communication:
β’ Presentation Skills β Explain insights to non-technical stakeholders
β’ Dashboard Best Practices β Clean UI, relevant KPIs, interactive visuals
7οΈβ£ Bonus: Automation & AI Integration
β’ SQL Query Optimization β Improve query performance
β’ Python Scripting β Automate repetitive tasks
β’ ChatGPT & AI Tools β Enhance productivity
Like this post if you need a complete tutorial on all these topics! πβ€οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#dataanalysts
1οΈβ£ Data Extraction & Processing:
β’ SQL β SELECT, JOIN, GROUP BY, CTE, WINDOW FUNCTIONS
β’ Python/R for Data Analysis β Pandas, NumPy, Matplotlib, Seaborn
β’ Excel β Pivot Tables, VLOOKUP, XLOOKUP, Power Query
2οΈβ£ Data Cleaning & Transformation:
β’ Handling Missing Data β COALESCE(), IFNULL(), DROPNA()
β’ Data Normalization β Removing duplicates, standardizing formats
β’ ETL Process β Extract, Transform, Load
3οΈβ£ Exploratory Data Analysis (EDA):
β’ Descriptive Statistics β Mean, Median, Mode, Variance, Standard Deviation
β’ Data Visualization β Bar Charts, Line Charts, Heatmaps, Histograms
4οΈβ£ Business Intelligence & Reporting:
β’ Power BI & Tableau β Dashboards, DAX, Filters, Drill-through
β’ Google Data Studio β Interactive reports
5οΈβ£ Data-Driven Decision Making:
β’ A/B Testing β Hypothesis testing, P-values
β’ Forecasting & Trend Analysis β Time Series Analysis
β’ KPI & Metrics Analysis β ROI, Churn Rate, Customer Segmentation
6οΈβ£ Data Storytelling & Communication:
β’ Presentation Skills β Explain insights to non-technical stakeholders
β’ Dashboard Best Practices β Clean UI, relevant KPIs, interactive visuals
7οΈβ£ Bonus: Automation & AI Integration
β’ SQL Query Optimization β Improve query performance
β’ Python Scripting β Automate repetitive tasks
β’ ChatGPT & AI Tools β Enhance productivity
Like this post if you need a complete tutorial on all these topics! πβ€οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#dataanalysts
π58β€29π₯5π₯°5π4π1π1
Which of the following tool/library is not used for data visualization?
Anonymous Quiz
11%
Power BI
3%
Tableau
15%
Matplotlib
72%
Django
π19π₯2π₯°2
Which of the following SQL join is used to combine each row of one table with each row of another table, and return the Cartesian product of the sets of rows from the tables that are joined?
Anonymous Quiz
12%
LEFT JOIN
16%
SELF JOIN
7%
RIGHT JOIN
65%
CROSS JOIN
π20π₯2β€1
SQL Interview Questions with detailed answers:
1οΈβ£2οΈβ£ What is a window function, and how is it different from GROUP BY?
A window function performs calculations across a set of table rows related to the current row, without collapsing the result set like GROUP BY.
Key Differences Between Window Functions and GROUP BY:
1οΈβ£ Window functions retain all rows, while GROUP BY collapses data into a smaller result set.
2οΈβ£ Window functions use aggregate functions like SUM(), AVG(), and RANK(), but they do not group data; instead, they compute results for each row individually within a defined window.
3οΈβ£ GROUP BY does not allow row-wise calculations, whereas window functions can provide rankings, running totals, and moving averages while keeping the original data intact.
4οΈβ£ Window functions support partitions, meaning they can reset calculations within groups using PARTITION BY. In contrast, GROUP BY always groups the entire dataset based on specified columns.
Example of a Window Function (SUM() Over a Window)
Here, SUM(salary) is calculated for each department separately, but all rows remain in the result.
Example of GROUP BY (Aggregates Data)
In this case, the result shows only one row per department, removing individual employee details.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
1οΈβ£2οΈβ£ What is a window function, and how is it different from GROUP BY?
A window function performs calculations across a set of table rows related to the current row, without collapsing the result set like GROUP BY.
Key Differences Between Window Functions and GROUP BY:
1οΈβ£ Window functions retain all rows, while GROUP BY collapses data into a smaller result set.
2οΈβ£ Window functions use aggregate functions like SUM(), AVG(), and RANK(), but they do not group data; instead, they compute results for each row individually within a defined window.
3οΈβ£ GROUP BY does not allow row-wise calculations, whereas window functions can provide rankings, running totals, and moving averages while keeping the original data intact.
4οΈβ£ Window functions support partitions, meaning they can reset calculations within groups using PARTITION BY. In contrast, GROUP BY always groups the entire dataset based on specified columns.
Example of a Window Function (SUM() Over a Window)
SELECT employee_id, department_id, salary, SUM(salary) OVER (PARTITION BY department_id ORDER BY employee_id) AS running_total FROM employees;
Here, SUM(salary) is calculated for each department separately, but all rows remain in the result.
Example of GROUP BY (Aggregates Data)
SELECT department_id, SUM(salary) FROM employees GROUP BY department_id;
In this case, the result shows only one row per department, removing individual employee details.
Top 20 SQL Interview Questions
Like this post if you want me to continue this SQL Interview Seriesβ₯οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
π15β€6
Data Analytics
If you want to Excel as a Data Analyst and land a high-paying job, master these essential skills: 1οΈβ£ Data Extraction & Processing: β’ SQL β SELECT, JOIN, GROUP BY, CTE, WINDOW FUNCTIONS β’ Python/R for Data Analysis β Pandas, NumPy, Matplotlib, Seaborn β’ Excelβ¦
Let me start with teaching each topic one by one.
Let's start with SQL first, as it's one of the most important skills.
Topic 1: SQL Basics for Data Analysts
SQL (Structured Query Language) is used to retrieve, manipulate, and analyze data stored in databases.
1οΈβ£ Understanding Databases & Tables
Databases store structured data in tables.
Tables contain rows (records) and columns (fields).
Each column has a specific data type (INTEGER, VARCHAR, DATE, etc.).
2οΈβ£ Basic SQL Commands
Let's start with some fundamental queries:
πΉ SELECT β Retrieve Data
πΉ WHERE β Filter Data
πΉ ORDER BY β Sort Data
πΉ LIMIT β Restrict Number of Results
πΉ DISTINCT β Remove Duplicates
Mini Task for You: Try to write an SQL query to fetch the top 3 highest-paid employees from an "employees" table.
You can find free SQL Resources here
ππ
https://t.iss.one/mysqldata
Like this post if you want me to continue covering all the topics! πβ€οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#sql
Let's start with SQL first, as it's one of the most important skills.
Topic 1: SQL Basics for Data Analysts
SQL (Structured Query Language) is used to retrieve, manipulate, and analyze data stored in databases.
1οΈβ£ Understanding Databases & Tables
Databases store structured data in tables.
Tables contain rows (records) and columns (fields).
Each column has a specific data type (INTEGER, VARCHAR, DATE, etc.).
2οΈβ£ Basic SQL Commands
Let's start with some fundamental queries:
πΉ SELECT β Retrieve Data
SELECT * FROM employees; -- Fetch all columns from 'employees' table SELECT name, salary FROM employees; -- Fetch specific columns
πΉ WHERE β Filter Data
SELECT * FROM employees WHERE department = 'Sales'; -- Filter by department SELECT * FROM employees WHERE salary > 50000; -- Filter by salary
πΉ ORDER BY β Sort Data
SELECT * FROM employees ORDER BY salary DESC; -- Sort by salary (highest first) SELECT name, hire_date FROM employees ORDER BY hire_date ASC; -- Sort by hire date (oldest first)
πΉ LIMIT β Restrict Number of Results
SELECT * FROM employees LIMIT 5; -- Fetch only 5 rows SELECT * FROM employees WHERE department = 'HR' LIMIT 10; -- Fetch first 10 HR employees
πΉ DISTINCT β Remove Duplicates
SELECT DISTINCT department FROM employees; -- Show unique departments
Mini Task for You: Try to write an SQL query to fetch the top 3 highest-paid employees from an "employees" table.
You can find free SQL Resources here
ππ
https://t.iss.one/mysqldata
Like this post if you want me to continue covering all the topics! πβ€οΈ
Share with credits: https://t.iss.one/sqlspecialist
Hope it helps :)
#sql
β€19π11π2
π2