Internshala
Internshala
Task
● Find all the non-local orders by looking at the salesmen that generated orders for their
customers but are located elsewhere unlike their customers, and fetch the details like
order_no, name of the customer, customer_id, salesman_id.
Table description
Input format
Table: salesman
Table: customer
Table: orders
Output format
Table: salesman
Table: customer
Table: orders
A food store is planning to give incentive to it's employees based on their monthly performance
in sales.
Incentive is different for each position and each position have it's max limit for incentive.
You are given the data for a month in the database store_data.
Task:
Input Format:
Table: employee
Table: incentive_details
incentive int Represents the amount of incentive made on completing single target
Output Format:
Sample Input:
Table: employee
Table: incentive_details
Sample Output:
employee_id incentive_made
201 45000
202 23500
203 23500
204 13000
205 50000
Table description
researchers A table that contains the list of all researchers at the institute
mentors A table that contains the list of all mentors at the institute
Table: researchers
Table: mentors
Table: research_paper
Table: research_mentor
Task
Write an SQL Query to find subjects that contain the alphabet "b" and have papers written under
the guidance of more female mentors than male mentors.
Sample Input
Table: researchers
R001 Mary F
R002 Alice F
R003 Bob M
R004 Ben M
R005 Mike M
R006 Tara F
R007 Anita F
R008 Lisa F
R009 Missy F
R010 John M
Table: mentors
M001 Rob M
M002 Jessica F
M003 Rachel F
M004 Joey M
M005 Monica F
Table: papers
p_id p_subject
P001 Microbiology
P004 Microbiology
P005 Microbiology
Table: research_paper
r_id p_id
R001 P001
R002 P002
R003 P003
R004 P004
R005 P005
R006 P001
R007 P002
R008 P003
R009 P004
R010 P005
Table: research_mentor
r_id m_id
R001 M005
R002 M004
R003 M003
R004 M002
R005 M001
R006 M005
R007 M004
R008 M003
R009 M002
R010 M001
Sample output:
p_subject
Microbiology