0% found this document useful (0 votes)
2 views4 pages

DS SQL Assignment (1)

The document is an assignment for a BA SQL task that includes various questions requiring SQL queries based on provided tables. It consists of tasks such as counting agents, fetching agents based on commission, and retrieving product views, purchases, and shares. Additionally, it involves finding specific salary rankings and candidates with required skills for a Data Science job.

Uploaded by

tareinirakar180
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

DS SQL Assignment (1)

The document is an assignment for a BA SQL task that includes various questions requiring SQL queries based on provided tables. It consists of tasks such as counting agents, fetching agents based on commission, and retrieving product views, purchases, and shares. Additionally, it involves finding specific salary rankings and candidates with required skills for a Data Science job.

Uploaded by

tareinirakar180
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BA 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:
Given a table of candidates and their skills, you're tasked with finding the candidates best suited for an
open Data Science job. You want to find candidates who are proficient in Python, Tableau, and
PostgreSQL.

Write a SQL query to list the candidates who possess all of the required skills for the job. Sort the the
output by candidate ID in ascending order.

Assumption:

• There are no duplicates in the candidates table.


candidates Table:
Column Name Type
candidate_id integer
skill varchar
candidates Example Input:
candidate_id skill
123 Python
123 Tableau
123 PostgreSQL
234 R
234 PowerBI
234 SQL Server
345 Python
345 Tableau
Example Output:
candidate_id
123
Explanation
Candidate 123 is displayed because they have Python, Tableau, and PostgreSQL skills. 345 isn't included
in the output because they're missing one of the required skills: PostgreSQL.

You might also like