SQL
SQL
1. Total views
2. Distinct Count of visitors
3. Avg secs visitors stayed on page
4. Total sales
Bottom 4
Collect, organize, and analyze data related to product assortment, sales, and
customer behavior.
***write a sql query the calculate net balance, running sum of credit balance table
and then add it to debit balance table
->WITH CreditRunningTotal AS (
SELECT
transaction_date,
amount AS credit_amount,
SUM(amount) OVER (ORDER BY transaction_date) AS running_credit_total
FROM
credit_balance
),
DebitRunningTotal AS (
SELECT
transaction_date,
amount AS debit_amount,
SUM(amount) OVER (ORDER BY transaction_date) AS running_debit_total
FROM
debit_balance
),
CombinedRunningTotal AS (
SELECT
c.transaction_date,
c.running_credit_total,
d.running_debit_total,
COALESCE(c.running_credit_total, 0) - COALESCE(d.running_debit_total, 0) AS
net_balance
FROM
CreditRunningTotal c
FULL OUTER JOIN
DebitRunningTotal d
ON
c.transaction_date = d.transaction_date
)
SELECT
transaction_date,
running_credit_total,
running_debit_total,
net_balance
FROM
CombinedRunningTotal
ORDER BY
transaction_date;
Use Python / SAS / SQL /Excel & other relevant technologies to deliver analytics,
dashboards, and automated recurring
insights/reports at desired frequency.
Develop and maintain reports and dashboards that communicate insights and findings
to key stakeholders.
Manage intake and transformation of large amounts of raw information in support of
advanced analytics.
Answer Business problems using a mix of Descriptive / Exploratory Analysis and
Storytelling using Visualization.
Present findings to stakeholders in an easily consumable manner.
Should be willing to work in 12.30PM to 9.30PM IST work shift and be flexible as
per business requirements (including initial
months of training & onboarding, leadership visits & critical business meetings)
Data Cleaning Exercise: You have a dataset with missing values and inconsistent
formats. What steps would you take in Power BI to clean this data?
3. Handling Large Datasets: If you're working with a very large dataset that is
slowing down Power BI, what strategies would you use to improve performance?
4. Complex DAX Challenge: Describe how you would use DAX to calculate year-over-
year growth in a dataset.
5. Data Modeling Case: You have sales data and customer data in separate tables.
How would you model this data in Power BI to analyze customer purchase behavior?
22. Find the customer who has placed the highest number of orders:
SELECT customer_id, COUNT(*) AS num_orders
FROM Orders
GROUP BY customer_id
ORDER BY num_orders DESC
LIMIT 1;
29. Retrieve the average time taken to ship orders for each shipping method:
SELECT shipping_method, AVG(DATEDIFF(DAY, order_date, ship_date)) AS
avg_shipping_time
FROM Orders
GROUP BY shipping_method;
30. Find the total number of unique customers who made purchases in each year:
SELECT EXTRACT(YEAR FROM order_date) AS year, COUNT(DISTINCT customer_id) AS
num_customers
FROM Orders
GROUP BY EXTRACT(YEAR FROM order_date);
Questions -
1) What is SQL. What are the different joins we can used ?
2) Gave me the three tables randomly maked by interviewer and told me to apply the
joins and give me the result ?
3)Define where and having clause.? They gave me a table and conditions then we have
to apply clause? Where clause is used with Group by or not ?
4) Rate yourself in Powe BI, SQL, Microsoft Excel out of 10 , and when i answered
they told me rate yourself always high.
5)Define different types of Look up function? Difference between Lookup and index
function in excel, You have to show how these function works with an example?
6)What formulas you know in excel? Define Advance Excel and what's the use of it ?
7)Define Nestedif and Ifs function with an example?
8)Define Power BI and ETL?
9)Define your projects? What type of analysis you did in your Projects?
10)How do you do data cleansing? How to deal with missing values?
11)Define Pandas? What is Statistical Analysis? what types of Statistical Analysis
you have done?
12)Define Mean, Median, Mode?
1. Write an SQL query to report the names of all the salespersons who did not have
any orders related to the company with the name "RED".
2. Write an SQL query to find the employees who earn more than their managers.
-> select
3. Write an SQL query to report all customres who never order anything.
->
4. Write an SQL query to find employees who have the highest salary in each of the
departments.
5. Write an SQL query to find all dates'id with higher temperatures compared to its
previous dates(yesterday).
how will handle time conflict while working with US based client using SQL query