35 Most Common SQL Interview Questions ππ
1.) Explain order of execution of SQL.
2.) What is difference between where and having?
3.) What is the use of group by?
4.) Explain all types of joins in SQL?
5.) What are triggers in SQL?
6.) What is stored procedure in SQL
7.) Explain all types of window functions?
(Mainly rank, row_num, dense_rank, lead & lag)
8.) What is difference between Delete and Truncate?
9.) What is difference between DML, DDL and DCL?
10.) What are aggregate function and when do we use them? explain with few example.
11.) Which is faster between CTE and Subquery?
12.) What are constraints and types of Constraints?
13.) Types of Keys?
14.) Different types of Operators ?
15.) Difference between Group By and Where?
16.) What are Views?
17.) What are different types of constraints?
18.) What is difference between varchar and nvarchar?
19.) Similar for char and nchar?
20.) What are index and their types?
21.) What is an index? Explain its different types.
22.) List the different types of relationships in SQL.
23.) Differentiate between UNION and UNION ALL.
24.) How many types of clauses in SQL?
25.) What is the difference between UNION and UNION ALL in SQL?
26.) What are the various types of relationships in SQL?
27.) Difference between Primary Key and Secondary Key?
28.) What is the difference between where and having?
29.) Find the second highest salary of an employee?
30.) Write retention query in SQL?
31.) Write year-on-year growth in SQL?
32.) Write a query for cummulative sum in SQL?
33.) Difference between Function and Store procedure ?
34.) Do we use variable in views?
35.) What are the limitations of views?
Here you can find essential SQL Interview Resourcesπ
https://t.iss.one/mysqldata
Like this post if you need more πβ€οΈ
Hope it helps :)
1.) Explain order of execution of SQL.
2.) What is difference between where and having?
3.) What is the use of group by?
4.) Explain all types of joins in SQL?
5.) What are triggers in SQL?
6.) What is stored procedure in SQL
7.) Explain all types of window functions?
(Mainly rank, row_num, dense_rank, lead & lag)
8.) What is difference between Delete and Truncate?
9.) What is difference between DML, DDL and DCL?
10.) What are aggregate function and when do we use them? explain with few example.
11.) Which is faster between CTE and Subquery?
12.) What are constraints and types of Constraints?
13.) Types of Keys?
14.) Different types of Operators ?
15.) Difference between Group By and Where?
16.) What are Views?
17.) What are different types of constraints?
18.) What is difference between varchar and nvarchar?
19.) Similar for char and nchar?
20.) What are index and their types?
21.) What is an index? Explain its different types.
22.) List the different types of relationships in SQL.
23.) Differentiate between UNION and UNION ALL.
24.) How many types of clauses in SQL?
25.) What is the difference between UNION and UNION ALL in SQL?
26.) What are the various types of relationships in SQL?
27.) Difference between Primary Key and Secondary Key?
28.) What is the difference between where and having?
29.) Find the second highest salary of an employee?
30.) Write retention query in SQL?
31.) Write year-on-year growth in SQL?
32.) Write a query for cummulative sum in SQL?
33.) Difference between Function and Store procedure ?
34.) Do we use variable in views?
35.) What are the limitations of views?
Here you can find essential SQL Interview Resourcesπ
https://t.iss.one/mysqldata
Like this post if you need more πβ€οΈ
Hope it helps :)
π7
SQL, or Structured Query Language, is a domain-specific language used to manage and manipulate relational databases. Here's a brief A-Z overview by @sqlanalyst
A - Aggregate Functions: Functions like COUNT, SUM, AVG, MIN, and MAX used to perform operations on data in a database.
B - BETWEEN: A SQL operator used to filter results within a specific range.
C - CREATE TABLE: SQL statement for creating a new table in a database.
D - DELETE: SQL statement used to delete records from a table.
E - EXISTS: SQL operator used in a subquery to test if a specified condition exists.
F - FOREIGN KEY: A field in a database table that is a primary key in another table, establishing a link between the two tables.
G - GROUP BY: SQL clause used to group rows that have the same values in specified columns.
H - HAVING: SQL clause used in combination with GROUP BY to filter the results.
I - INNER JOIN: SQL clause used to combine rows from two or more tables based on a related column between them.
J - JOIN: Combines rows from two or more tables based on a related column.
K - KEY: A field or set of fields in a database table that uniquely identifies each record.
L - LIKE: SQL operator used in a WHERE clause to search for a specified pattern in a column.
M - MODIFY: SQL command used to modify an existing database table.
N - NULL: Represents missing or undefined data in a database.
O - ORDER BY: SQL clause used to sort the result set in ascending or descending order.
P - PRIMARY KEY: A field in a table that uniquely identifies each record in that table.
Q - QUERY: A request for data from a database using SQL.
R - ROLLBACK: SQL command used to undo transactions that have not been saved to the database.
S - SELECT: SQL statement used to query the database and retrieve data.
T - TRUNCATE: SQL command used to delete all records from a table without logging individual row deletions.
U - UPDATE: SQL statement used to modify the existing records in a table.
V - VIEW: A virtual table based on the result of a SELECT query.
W - WHERE: SQL clause used to filter the results of a query based on a specified condition.
X - (E)XISTS: Used in conjunction with SELECT to test the existence of rows returned by a subquery.
Z - ZERO: Represents the absence of a value in numeric fields or the initial state of boolean fields.
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
A - Aggregate Functions: Functions like COUNT, SUM, AVG, MIN, and MAX used to perform operations on data in a database.
B - BETWEEN: A SQL operator used to filter results within a specific range.
C - CREATE TABLE: SQL statement for creating a new table in a database.
D - DELETE: SQL statement used to delete records from a table.
E - EXISTS: SQL operator used in a subquery to test if a specified condition exists.
F - FOREIGN KEY: A field in a database table that is a primary key in another table, establishing a link between the two tables.
G - GROUP BY: SQL clause used to group rows that have the same values in specified columns.
H - HAVING: SQL clause used in combination with GROUP BY to filter the results.
I - INNER JOIN: SQL clause used to combine rows from two or more tables based on a related column between them.
J - JOIN: Combines rows from two or more tables based on a related column.
K - KEY: A field or set of fields in a database table that uniquely identifies each record.
L - LIKE: SQL operator used in a WHERE clause to search for a specified pattern in a column.
M - MODIFY: SQL command used to modify an existing database table.
N - NULL: Represents missing or undefined data in a database.
O - ORDER BY: SQL clause used to sort the result set in ascending or descending order.
P - PRIMARY KEY: A field in a table that uniquely identifies each record in that table.
Q - QUERY: A request for data from a database using SQL.
R - ROLLBACK: SQL command used to undo transactions that have not been saved to the database.
S - SELECT: SQL statement used to query the database and retrieve data.
T - TRUNCATE: SQL command used to delete all records from a table without logging individual row deletions.
U - UPDATE: SQL statement used to modify the existing records in a table.
V - VIEW: A virtual table based on the result of a SELECT query.
W - WHERE: SQL clause used to filter the results of a query based on a specified condition.
X - (E)XISTS: Used in conjunction with SELECT to test the existence of rows returned by a subquery.
Z - ZERO: Represents the absence of a value in numeric fields or the initial state of boolean fields.
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
β€7π5
Learn SQL: Step-by-step Guide for Beginners!
π 1. Start with the Basics β SQL Commands
SQL is divided into various command categories, each with a unique purpose:
- DML (Data Manipulation Language) β Commands like INSERT, UPDATE, and DELETE let you manage data within tables.
- DDL (Data Definition Language) β Commands like CREATE, DROP, and ALTER define the structure of your tables and databases.
- DQL (Data Query Language) β SELECT statements allow you to query and retrieve data from tables.
- DCL (Data Control Language) β GRANT and REVOKE control access to your database, essential for security.
- TCL (Transaction Control Language) β Use COMMIT, ROLLBACK, and SAVEPOINT to manage transactions effectively.
π 2. Essential Operators
Understanding operators is key for crafting complex queries:
- Logical Operators β Use AND, OR, and NOT to create conditional statements.
- Comparison Operators β =, >, <, etc., help you filter results based on specific criteria.
π 3. Functions for Every Need
SQL offers various functions to manipulate and analyze data:
- Numeric Functions β Perform calculations and work with numbers.
- String Functions β Manage text data, perfect for working with names or descriptions.
- Datetime Functions β Handle date and time data, crucial for timelines and scheduling.
- NULL Functions β Deal with missing or undefined values in your data.
π 4. Data Types
Knowing data types (e.g., Numeric, String, Datetime, Boolean, JSON) is essential for defining your tables accurately. Choose the right data type to optimize storage and performance.
π 5. Joins and Filtering
One of the most powerful aspects of SQL is combining data from multiple tables:
- JOIN Types β INNER JOIN, LEFT JOIN, RIGHT JOIN, and more allow you to bring related data together based on common keys.
- Filtering β Use WHERE, GROUP BY, HAVING, and ORDER BY clauses to refine your queries and get specific insights.
πΌ 6. Working with Transactions
For applications where data integrity is key, learning transaction control (COMMIT, ROLLBACK) ensures consistency, especially in multi-step operations.
π Save this guide and keep it handy for your SQL learning journey! Whether you're just starting or looking to level up, SQL is a critical skill for anyone working with data. The more you practice, the more powerful your queries will become.
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
π 1. Start with the Basics β SQL Commands
SQL is divided into various command categories, each with a unique purpose:
- DML (Data Manipulation Language) β Commands like INSERT, UPDATE, and DELETE let you manage data within tables.
- DDL (Data Definition Language) β Commands like CREATE, DROP, and ALTER define the structure of your tables and databases.
- DQL (Data Query Language) β SELECT statements allow you to query and retrieve data from tables.
- DCL (Data Control Language) β GRANT and REVOKE control access to your database, essential for security.
- TCL (Transaction Control Language) β Use COMMIT, ROLLBACK, and SAVEPOINT to manage transactions effectively.
π 2. Essential Operators
Understanding operators is key for crafting complex queries:
- Logical Operators β Use AND, OR, and NOT to create conditional statements.
- Comparison Operators β =, >, <, etc., help you filter results based on specific criteria.
π 3. Functions for Every Need
SQL offers various functions to manipulate and analyze data:
- Numeric Functions β Perform calculations and work with numbers.
- String Functions β Manage text data, perfect for working with names or descriptions.
- Datetime Functions β Handle date and time data, crucial for timelines and scheduling.
- NULL Functions β Deal with missing or undefined values in your data.
π 4. Data Types
Knowing data types (e.g., Numeric, String, Datetime, Boolean, JSON) is essential for defining your tables accurately. Choose the right data type to optimize storage and performance.
π 5. Joins and Filtering
One of the most powerful aspects of SQL is combining data from multiple tables:
- JOIN Types β INNER JOIN, LEFT JOIN, RIGHT JOIN, and more allow you to bring related data together based on common keys.
- Filtering β Use WHERE, GROUP BY, HAVING, and ORDER BY clauses to refine your queries and get specific insights.
πΌ 6. Working with Transactions
For applications where data integrity is key, learning transaction control (COMMIT, ROLLBACK) ensures consistency, especially in multi-step operations.
π Save this guide and keep it handy for your SQL learning journey! Whether you're just starting or looking to level up, SQL is a critical skill for anyone working with data. The more you practice, the more powerful your queries will become.
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
π2β€1
SQL can be simpleβif you learn it the smart way..
If youβre aiming to become a data analyst, mastering SQL is non-negotiable.
Hereβs a smart roadmap to ace it:
1. Basics First: Understand data types, simple queries (SELECT, FROM, WHERE). Master basic filtering.
2. Joins & Relationships: Dive into INNER, LEFT, RIGHT joins. Practice combining tables to extract meaningful insights.
3. Aggregations & Functions: Get comfortable with COUNT, SUM, AVG, MAX, GROUP BY, and HAVING clauses. These are essential for summarizing data.
4. Subqueries & Nested Queries: Learn how to query within queries. This is powerful for handling complex datasets.
5. Window Functions: Explore ranking, cumulative sums, and sliding windows to work with running totals and moving averages.
6. Optimization: Study indexing and query optimization for faster, more efficient queries.
7. Real-World Scenarios: Apply your SQL knowledge to solve real-world business problems.
The journey may seem tough, but each step sharpens your skills and brings you closer to data analysis excellence. Stay consistent, practice regularly, and let SQL become your superpower! πͺ
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
If youβre aiming to become a data analyst, mastering SQL is non-negotiable.
Hereβs a smart roadmap to ace it:
1. Basics First: Understand data types, simple queries (SELECT, FROM, WHERE). Master basic filtering.
2. Joins & Relationships: Dive into INNER, LEFT, RIGHT joins. Practice combining tables to extract meaningful insights.
3. Aggregations & Functions: Get comfortable with COUNT, SUM, AVG, MAX, GROUP BY, and HAVING clauses. These are essential for summarizing data.
4. Subqueries & Nested Queries: Learn how to query within queries. This is powerful for handling complex datasets.
5. Window Functions: Explore ranking, cumulative sums, and sliding windows to work with running totals and moving averages.
6. Optimization: Study indexing and query optimization for faster, more efficient queries.
7. Real-World Scenarios: Apply your SQL knowledge to solve real-world business problems.
The journey may seem tough, but each step sharpens your skills and brings you closer to data analysis excellence. Stay consistent, practice regularly, and let SQL become your superpower! πͺ
Here you can find essential SQL Interview Resourcesπ
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
π3
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://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
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://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more πβ€οΈ
Hope it helps :)
π6β€1
Top 5 SQL Functions
https://t.iss.one/sqlanalyst
1. SELECT Statement:
- Function: Retrieving data from one or more tables.
- Example:
2. COUNT Function:
- Function: Counts the number of rows that meet a specified condition.
- Example:
3. SUM Function:
- Function: Calculates the sum of values in a numeric column.
- Example:
4. AVG Function:
- Function: Computes the average value of a numeric column.
- Example:
5. GROUP BY Clause:
- Function: Groups rows that have the same values in specified columns into summary rows.
- Example:
These functions are fundamental in SQL and are frequently used for various data manipulation tasks, including data retrieval, aggregation, and analysis.
https://t.iss.one/sqlanalyst
1. SELECT Statement:
- Function: Retrieving data from one or more tables.
- Example:
SELECT column1, column2 FROM table WHERE condition;2. COUNT Function:
- Function: Counts the number of rows that meet a specified condition.
- Example:
SELECT COUNT(column) FROM table WHERE condition;3. SUM Function:
- Function: Calculates the sum of values in a numeric column.
- Example:
SELECT SUM(column) FROM table WHERE condition;4. AVG Function:
- Function: Computes the average value of a numeric column.
- Example:
SELECT AVG(column) FROM table WHERE condition;5. GROUP BY Clause:
- Function: Groups rows that have the same values in specified columns into summary rows.
- Example:
SELECT column, AVG(numeric_column) FROM table GROUP BY column;These functions are fundamental in SQL and are frequently used for various data manipulation tasks, including data retrieval, aggregation, and analysis.
π4β€3
Basics of SQL ππ
1. SQL (Structured Query Language) is a standard programming language used for managing and manipulating relational databases.
2. SQL operates through simple, declarative statements. These statements are used to perform tasks such as querying data, updating data, inserting data, and deleting data from a database.
3. The basic SQL commands include SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP.
4. The SELECT statement is used to retrieve data from a database. It allows you to specify the columns you want to retrieve and filter the results using conditions.
5. The INSERT statement is used to add new records to a table in a database.
6. The UPDATE statement is used to modify existing records in a table.
7. The DELETE statement is used to remove records from a table.
8. The CREATE statement is used to create new tables, indexes, or views in a database.
9. The DROP statement is used to remove tables, indexes, or views from a database.
10. SQL also supports various operators such as AND, OR, NOT, LIKE, IN, BETWEEN, and ORDER BY for filtering and sorting data.
11. SQL also allows for the use of functions and aggregate functions like SUM, AVG, COUNT, MIN, and MAX to perform calculations on data.
12. SQL statements are case-insensitive but conventionally written in uppercase for readability.
13. SQL databases are relational databases that store data in tables with rows and columns. Tables can be related to each other through primary and foreign keys.
14. SQL databases use transactions to ensure data integrity and consistency. Transactions can be committed (saved) or rolled back (undone) based on the success of the operations.
15. SQL databases support indexing for faster data retrieval and performance optimization.
16. SQL databases can be queried using tools like MySQL, PostgreSQL, Oracle Database, SQL Server, SQLite, and others.
Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like if you need more similar content
Hope it helps :)
1. SQL (Structured Query Language) is a standard programming language used for managing and manipulating relational databases.
2. SQL operates through simple, declarative statements. These statements are used to perform tasks such as querying data, updating data, inserting data, and deleting data from a database.
3. The basic SQL commands include SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP.
4. The SELECT statement is used to retrieve data from a database. It allows you to specify the columns you want to retrieve and filter the results using conditions.
5. The INSERT statement is used to add new records to a table in a database.
6. The UPDATE statement is used to modify existing records in a table.
7. The DELETE statement is used to remove records from a table.
8. The CREATE statement is used to create new tables, indexes, or views in a database.
9. The DROP statement is used to remove tables, indexes, or views from a database.
10. SQL also supports various operators such as AND, OR, NOT, LIKE, IN, BETWEEN, and ORDER BY for filtering and sorting data.
11. SQL also allows for the use of functions and aggregate functions like SUM, AVG, COUNT, MIN, and MAX to perform calculations on data.
12. SQL statements are case-insensitive but conventionally written in uppercase for readability.
13. SQL databases are relational databases that store data in tables with rows and columns. Tables can be related to each other through primary and foreign keys.
14. SQL databases use transactions to ensure data integrity and consistency. Transactions can be committed (saved) or rolled back (undone) based on the success of the operations.
15. SQL databases support indexing for faster data retrieval and performance optimization.
16. SQL databases can be queried using tools like MySQL, PostgreSQL, Oracle Database, SQL Server, SQLite, and others.
Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like if you need more similar content
Hope it helps :)
β€9π1
Data Analyst Scenario based Question and Answers ππ
1. Scenario: Creating a Dynamic Sales Growth Report in Power BI
Approach:
Load Data: Import sales data and calendar tables.
Data Model: Establish a relationship between the sales and calendar tables.
Create Measures:
Current Sales: Current Sales = SUM(Sales[Amount]).
Previous Year Sales: Previous Year Sales = CALCULATE(SUM(Sales[Amount]), DATEADD(Calendar[Date], -1, YEAR)).
Sales Growth: Sales Growth = [Current Sales] - [Previous Year Sales].
Visualization:
Use Line Chart for trends.
Use Card Visual for displaying numeric growth values.
Slicers and Filters: Add slicers for selecting specific time periods.
2. Scenario: Identifying Top 5 Customers by Revenue in SQL
Approach:
Understand the Schema: Know the relevant tables and columns, e.g., Orders table with CustomerID and Revenue.
SQL Query:
SELECT TOP 5 CustomerID, SUM(Revenue) AS TotalRevenue
FROM Orders
GROUP BY CustomerID
ORDER BY TotalRevenue DESC;
3. Scenario: Creating a Monthly Sales Forecast in Power BI
Approach:
Load Historical Data: Import historical sales data.
Data Model: Ensure proper relationships.
Time Series Analysis:
Use built-in Power BI forecasting features.
Create measures for historical and forecasted sales.
Visualization:
Use a Line Chart to display historical and forecasted sales.
Adjust Forecast Parameters: Customize the forecast length and confidence intervals.
4. Scenario: Updating a SQL Table with New Data
Approach:
Understand the Schema: Identify the table and columns to be updated.
SQL Query:
UPDATE Employees
SET JobTitle = 'Senior Developer'
WHERE EmployeeID = 1234;
5. Scenario: Creating a Custom KPI in Power BI
Approach:
Define KPI: Identify the key performance indicators.
Create Measures:
Define the KPI measure using DAX.
Visualization:
Use KPI Visual or Card Visual.
Configure the target and actual values.
Conditional Formatting: Apply conditional formatting based on the KPI thresholds.
Data Analytics Resources
ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
1. Scenario: Creating a Dynamic Sales Growth Report in Power BI
Approach:
Load Data: Import sales data and calendar tables.
Data Model: Establish a relationship between the sales and calendar tables.
Create Measures:
Current Sales: Current Sales = SUM(Sales[Amount]).
Previous Year Sales: Previous Year Sales = CALCULATE(SUM(Sales[Amount]), DATEADD(Calendar[Date], -1, YEAR)).
Sales Growth: Sales Growth = [Current Sales] - [Previous Year Sales].
Visualization:
Use Line Chart for trends.
Use Card Visual for displaying numeric growth values.
Slicers and Filters: Add slicers for selecting specific time periods.
2. Scenario: Identifying Top 5 Customers by Revenue in SQL
Approach:
Understand the Schema: Know the relevant tables and columns, e.g., Orders table with CustomerID and Revenue.
SQL Query:
SELECT TOP 5 CustomerID, SUM(Revenue) AS TotalRevenue
FROM Orders
GROUP BY CustomerID
ORDER BY TotalRevenue DESC;
3. Scenario: Creating a Monthly Sales Forecast in Power BI
Approach:
Load Historical Data: Import historical sales data.
Data Model: Ensure proper relationships.
Time Series Analysis:
Use built-in Power BI forecasting features.
Create measures for historical and forecasted sales.
Visualization:
Use a Line Chart to display historical and forecasted sales.
Adjust Forecast Parameters: Customize the forecast length and confidence intervals.
4. Scenario: Updating a SQL Table with New Data
Approach:
Understand the Schema: Identify the table and columns to be updated.
SQL Query:
UPDATE Employees
SET JobTitle = 'Senior Developer'
WHERE EmployeeID = 1234;
5. Scenario: Creating a Custom KPI in Power BI
Approach:
Define KPI: Identify the key performance indicators.
Create Measures:
Define the KPI measure using DAX.
Visualization:
Use KPI Visual or Card Visual.
Configure the target and actual values.
Conditional Formatting: Apply conditional formatting based on the KPI thresholds.
Data Analytics Resources
ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
π8
If you have ever given an SQL interview some of the questions would be definitely from below list :
1- How to find duplicates in a table
2- How to delete duplicates from a table
3- Difference between union and union all
4- Difference between rank,row_number and dense_rank
5- Find records in a table which are not present in another table
6- Find second highest salary employees in each department
7- Find employees with salary more than their manager's salary
8- Difference between inner and left join
9- update a table and swap gender values.
If not exact at least flavor of these questions are always asked in interviews irrespective of your experience level
1- How to find duplicates in a table
2- How to delete duplicates from a table
3- Difference between union and union all
4- Difference between rank,row_number and dense_rank
5- Find records in a table which are not present in another table
6- Find second highest salary employees in each department
7- Find employees with salary more than their manager's salary
8- Difference between inner and left join
9- update a table and swap gender values.
If not exact at least flavor of these questions are always asked in interviews irrespective of your experience level
π8
Scenario based Interview Questions & Answers for Data Analyst
1. Scenario: You are working on a SQL database that stores customer information. The database has a table called "Orders" that contains order details. Your task is to write a SQL query to retrieve the total number of orders placed by each customer.
Question:
- Write a SQL query to find the total number of orders placed by each customer.
Expected Answer:
SELECT CustomerID, COUNT(*) AS TotalOrders
FROM Orders
GROUP BY CustomerID;
2. Scenario: You are working on a SQL database that stores employee information. The database has a table called "Employees" that contains employee details. Your task is to write a SQL query to retrieve the names of all employees who have been with the company for more than 5 years.
Question:
- Write a SQL query to find the names of employees who have been with the company for more than 5 years.
Expected Answer:
SELECT Name
FROM Employees
WHERE DATEDIFF(year, HireDate, GETDATE()) > 5;
Power BI Scenario-Based Questions
1. Scenario: You have been given a dataset in Power BI that contains sales data for a company. Your task is to create a report that shows the total sales by product category and region.
Expected Answer:
- Load the dataset into Power BI.
- Create relationships if necessary.
- Use the "Fields" pane to select the necessary fields (Product Category, Region, Sales).
- Drag these fields into the "Values" area of a new visualization (e.g., a table or bar chart).
- Use the "Filters" pane to filter data as needed.
- Format the visualization to enhance clarity and readability.
2. Scenario: You have been asked to create a Power BI dashboard that displays real-time stock prices for a set of companies. The stock prices are available through an API.
Expected Answer:
- Use Power BI Desktop to connect to the API.
- Go to "Get Data" > "Web" and enter the API URL.
- Configure the data refresh settings to ensure real-time updates (e.g., setting up a scheduled refresh or using DirectQuery if supported).
- Create visualizations using the imported data.
- Publish the report to the Power BI service and set up a data gateway if needed for continuous refresh.
3. Scenario: You have been given a Power BI report that contains multiple visualizations. The report is taking a long time to load and is impacting the performance of the application.
Expected Answer:
- Analyze the current performance using Performance Analyzer.
- Optimize data model by reducing the number of columns and rows, and removing unnecessary calculations.
- Use aggregated tables to pre-compute results.
- Simplify DAX calculations.
- Optimize visualizations by reducing the number of visuals per page and avoiding complex custom visuals.
- Ensure proper indexing on the data source.
Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like if you need more similar content
Hope it helps :)
1. Scenario: You are working on a SQL database that stores customer information. The database has a table called "Orders" that contains order details. Your task is to write a SQL query to retrieve the total number of orders placed by each customer.
Question:
- Write a SQL query to find the total number of orders placed by each customer.
Expected Answer:
SELECT CustomerID, COUNT(*) AS TotalOrders
FROM Orders
GROUP BY CustomerID;
2. Scenario: You are working on a SQL database that stores employee information. The database has a table called "Employees" that contains employee details. Your task is to write a SQL query to retrieve the names of all employees who have been with the company for more than 5 years.
Question:
- Write a SQL query to find the names of employees who have been with the company for more than 5 years.
Expected Answer:
SELECT Name
FROM Employees
WHERE DATEDIFF(year, HireDate, GETDATE()) > 5;
Power BI Scenario-Based Questions
1. Scenario: You have been given a dataset in Power BI that contains sales data for a company. Your task is to create a report that shows the total sales by product category and region.
Expected Answer:
- Load the dataset into Power BI.
- Create relationships if necessary.
- Use the "Fields" pane to select the necessary fields (Product Category, Region, Sales).
- Drag these fields into the "Values" area of a new visualization (e.g., a table or bar chart).
- Use the "Filters" pane to filter data as needed.
- Format the visualization to enhance clarity and readability.
2. Scenario: You have been asked to create a Power BI dashboard that displays real-time stock prices for a set of companies. The stock prices are available through an API.
Expected Answer:
- Use Power BI Desktop to connect to the API.
- Go to "Get Data" > "Web" and enter the API URL.
- Configure the data refresh settings to ensure real-time updates (e.g., setting up a scheduled refresh or using DirectQuery if supported).
- Create visualizations using the imported data.
- Publish the report to the Power BI service and set up a data gateway if needed for continuous refresh.
3. Scenario: You have been given a Power BI report that contains multiple visualizations. The report is taking a long time to load and is impacting the performance of the application.
Expected Answer:
- Analyze the current performance using Performance Analyzer.
- Optimize data model by reducing the number of columns and rows, and removing unnecessary calculations.
- Use aggregated tables to pre-compute results.
- Simplify DAX calculations.
- Optimize visualizations by reducing the number of visuals per page and avoiding complex custom visuals.
- Ensure proper indexing on the data source.
Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like if you need more similar content
Hope it helps :)
π10β€1
π Data Analyst Project Ideas for Beginners
1. Sales Analysis Dashboard: Use tools like Excel or Tableau to create a dashboard analyzing sales data. Visualize trends, top products, and seasonal patterns.
2. Customer Segmentation: Analyze customer data using clustering techniques (like K-means) to segment customers based on purchasing behavior and demographics.
3. Social Media Metrics Analysis: Gather data from social media platforms to analyze engagement metrics. Create visualizations to highlight trends and performance.
4. Survey Data Analysis: Conduct a survey and analyze the results using statistical techniques. Present findings with visualizations to showcase insights.
5. Exploratory Data Analysis (EDA): Choose a public dataset and perform EDA using Python (Pandas, Matplotlib) or R (tidyverse). Summarize key insights and visualizations.
6. Employee Performance Analysis: Analyze employee performance data to identify trends in productivity, turnover rates, and training effectiveness.
7. Public Health Data Analysis: Use datasets from public health sources (like CDC) to analyze trends in health metrics (e.g., vaccination rates, disease outbreaks) and visualize findings.
8. Real Estate Market Analysis: Analyze real estate listings to find trends in pricing, location, and features. Use data visualization to present your findings.
9. Weather Data Visualization: Collect weather data and analyze trends over time. Create visualizations to show changes in temperature, precipitation, or extreme weather events.
10. Financial Analysis: Analyze a companyβs financial statements to assess its performance over time. Create visualizations to highlight key financial ratios and trends.
Data Analytics Resources ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
1. Sales Analysis Dashboard: Use tools like Excel or Tableau to create a dashboard analyzing sales data. Visualize trends, top products, and seasonal patterns.
2. Customer Segmentation: Analyze customer data using clustering techniques (like K-means) to segment customers based on purchasing behavior and demographics.
3. Social Media Metrics Analysis: Gather data from social media platforms to analyze engagement metrics. Create visualizations to highlight trends and performance.
4. Survey Data Analysis: Conduct a survey and analyze the results using statistical techniques. Present findings with visualizations to showcase insights.
5. Exploratory Data Analysis (EDA): Choose a public dataset and perform EDA using Python (Pandas, Matplotlib) or R (tidyverse). Summarize key insights and visualizations.
6. Employee Performance Analysis: Analyze employee performance data to identify trends in productivity, turnover rates, and training effectiveness.
7. Public Health Data Analysis: Use datasets from public health sources (like CDC) to analyze trends in health metrics (e.g., vaccination rates, disease outbreaks) and visualize findings.
8. Real Estate Market Analysis: Analyze real estate listings to find trends in pricing, location, and features. Use data visualization to present your findings.
9. Weather Data Visualization: Collect weather data and analyze trends over time. Create visualizations to show changes in temperature, precipitation, or extreme weather events.
10. Financial Analysis: Analyze a companyβs financial statements to assess its performance over time. Create visualizations to highlight key financial ratios and trends.
Data Analytics Resources ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
π3β€1
SQL Round Interview Questions of Urban Company:-
Question 1: Monthly Revenue Trends by Category
Scenario: Analyze monthly revenue trends for each product category.
Table:
1. transactions (Transaction_id, Product_id, Amount_spent, Transaction_date),
2. products (Product_id, Category)
Challenge: Write a SQL query to calculate the total revenue for each category on a monthly basis and identify the top 3 categories with the highest revenue growth month-over-month.
Question 2: Customer Retention Analysis
Scenario: Determine the retention rate of customers.
Table:
1. customer_visits (Customer_id, Visit_date)
Challenge: Write a SQL query to calculate the retention rate of customers month-over-month for the past year, identifying the percentage of customers who return the following month.
Question 3: Product Affinity Analysis
Scenario: Identify products that are frequently bought together.
Table:
1. order_details (Order_id, Product_id, Quantity)
Challenge: Write a SQL query to find pairs of products that are frequently bought together. Include the count of how many times each pair appears in the same order and rank them by frequency.
Question 4: Customer Purchase Segmentation
Scenario: Segment customers based on their purchase behavior.
Table:
1. purchases (Customer_id, Product_id, Amount_spent, Purchase_date)
Challenge: Write a SQL query to segment customers into different groups based on their total spending and purchase frequency in the last year. Classify them into categories like 'High Spenders', 'Medium Spenders', and 'Low Spenders'.
Question 5: Anomaly Detection in Transactions
Scenario: Detect anomalies in transaction amounts.
Table:
1. transactions (Transaction_id, Customer_id, Amount_spent, Transaction_date)
Challenge: Write a SQL query to identify transactions that deviate significantly from the customer's average spending. Flag transactions that are more than three standard deviations away from the mean spending amount for each customer.
Data Analytics Resources
ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
Question 1: Monthly Revenue Trends by Category
Scenario: Analyze monthly revenue trends for each product category.
Table:
1. transactions (Transaction_id, Product_id, Amount_spent, Transaction_date),
2. products (Product_id, Category)
Challenge: Write a SQL query to calculate the total revenue for each category on a monthly basis and identify the top 3 categories with the highest revenue growth month-over-month.
Question 2: Customer Retention Analysis
Scenario: Determine the retention rate of customers.
Table:
1. customer_visits (Customer_id, Visit_date)
Challenge: Write a SQL query to calculate the retention rate of customers month-over-month for the past year, identifying the percentage of customers who return the following month.
Question 3: Product Affinity Analysis
Scenario: Identify products that are frequently bought together.
Table:
1. order_details (Order_id, Product_id, Quantity)
Challenge: Write a SQL query to find pairs of products that are frequently bought together. Include the count of how many times each pair appears in the same order and rank them by frequency.
Question 4: Customer Purchase Segmentation
Scenario: Segment customers based on their purchase behavior.
Table:
1. purchases (Customer_id, Product_id, Amount_spent, Purchase_date)
Challenge: Write a SQL query to segment customers into different groups based on their total spending and purchase frequency in the last year. Classify them into categories like 'High Spenders', 'Medium Spenders', and 'Low Spenders'.
Question 5: Anomaly Detection in Transactions
Scenario: Detect anomalies in transaction amounts.
Table:
1. transactions (Transaction_id, Customer_id, Amount_spent, Transaction_date)
Challenge: Write a SQL query to identify transactions that deviate significantly from the customer's average spending. Flag transactions that are more than three standard deviations away from the mean spending amount for each customer.
Data Analytics Resources
ππ
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
π5β€2