Power BI SQL Assignment – Inference Labs
Instructions:
Kindly use any method/technique that you find suitable to get to the required
results
Write your Answers in a NEW File(notepad/word) and share with HR
Team. Do mention your NAME and CONTACT Number in Answer
Sheet.
All the best!
---------------------------------------------------------------------------------------------------------------------------------
Table Name: AGENTS
Using Above Table, Solve the following 3 questions given below.
Question 1:
Write a Query to count the number of agents in each working area.
Question 2:
Write a query to fetch all agents whose commission is between 0.11 to 0.14
Question 3:
Write a query to fetch agent name whose name end with ‘n’ and ‘r’
Question 4:
1. An e-commerce app allows users to share the product on various social
platforms with their friends before purchasing. A user has to view the
product, can share it with friends and can decide to purchase it or not. The
following tables capture the user actions for a few products
a. Product_View
Product_Id Product_Views
1001 1200
1002 1305
1003 1000
1005 700
b. Product_Purchase
Order_ID Product_Id Order_Quantity
OD001 1001 2
OD002 1001 1
OD003 1003 4
OD004 1002 2
OD005 1001 1
OD005 1003 3
c. Product_Shares
Product_Id Product_Shares
1001 200
1003 130
1002 80
Write a query to fetch data in the following manner:
Product_ID Product_Views Order_Quantity Product_Shares
Question 5:
Write SQL query to find the 3rd highest salary from a table using TOP keyword and subquery
only.
Question 6:
Write a query to fetch two minimum salaries from the above table
Question 7:
The matches table contains data for cricket matches between different teams and the
winner.
Match_ID Team_1 Team_2 Winner
0001 CSK MI MI
0001 MI CSK MI
0002 MI KKR MI
0003 RCB RR RR
0003 RCB RR RR
0002 KKR MI MI
Write a query to filter out redundant records from the table (e.g. row 1 and row 2 refers to
the same match, so we need to keep only 1 of these rows in resultant table (Don’t use
Delete query))
Question 8:
The students table contains attendance record for students in a particular week (Monday to
Saturday with no holidays in between).
Table structure:
Column Name Values
Date Date Type
Name Char Type
Present Char Type; Either “Yes” or “No” values
only
Write a query to identify students (Names) who have attended classes for at least 3
consecutive days (Attendance of 3 or more consecutive days)?
Question 9:
Using the transactions table as described below, find out the count of users who
transacted for the first time on a Monday (Not to be mistaken for identifying
customers who have transacted on any Monday).