Professional Documents
Culture Documents
Week6 Skillbuilder
Week6 Skillbuilder
Test Summary
No. of Sections: 1
No. of Questions: 5
Total Duration: 30 min
Section 1 - COD
Section Summary
No. of Questions: 5
Duration: 30 min
Additional Instructions:
None
Input Format
The input records are already prepopulated, as given in the problem statement.
Output Format
The output will display the orders issued by the salesman 'Paul Adam'.
ord_
7001
In a university, there are multiple courses and students. We have a database with two
"age". The "enrollments" table has columns "student_id" and "course_name". Write an S
another student is also enrolled in.
Input Format
The input records are already prepopulated, as given in the problem statement.
Output Format
name
Mike
Isol
Shra
Time Limit: - ms Memory Limit: - kb Code Size: - kb
Write a SQL query to find those employees who work in a department where the emplo
emp_det table(Example)
Input Format
The input records are already prepopulated, as given in the problem statement.
Output Format
emp_
123
124
234
Time Limit: - ms Memory Limit: - kb Code Size: - kb
Q4. Problem Statement
Consider to the table "emp_det" which has column values "emp_id", "fist_name", "last_
employees who earn more than an employee whose last name is 'Arvind'. Sort the resul
emp_det table(Example)
Input Format
The input records are already prepopulated, as given in the problem statement.
Output Format
emp_
124
234
256
Time Limit: - ms Memory Limit: - kb Code Size: - kb
Write a query to find departments for a particular location. The location matches the l
dept_det table(Example)
Input Format
The input records are already prepopulated, as given in the problem statement.
Output Format
name
HR
Input Output
ord_no pu
70011 75
Weightage - 100
ord_no pu
70011 75
Solution
SELECT *
FROM orders
WHERE salesman_id =
(SELECT salesman_id
FROM salesman
WHERE name='Paul Adam');
Q2
Test Case
Input Output
nam
Mik
Iso
Shr
Weightage - 100
nam
Mik
Iso
Shr
Solution
SELECT name1
FROM Students
WHERE id IN (
SELECT DISTINCT e1.student_id
FROM enrollments e1
WHERE e1.course_name IN (
SELECT e2.course_name
FROM enrollments e2
WHERE e2.student_id != e1.student_id
)
)
Q3
Test Case
Input Output
emp_id fi
123 S
124 Sj
234 Sk
Weightage - 100
emp_id fi
123 S
124 Sj
234 Sk
Solution
Q4
Test Case
Input Output
emp
124
234
Weightage - 100
emp
124
234
Solution
SELECT *from emp_det where salary >(select salary from emp_det where last_name
Q5 Test Case
Input Output
nam
HR
Weightage - 100
Solution