Access Millions of academic & study documents

University of Engineering and Technology

Content type
User Generated
Subject
Computer Science
School
University of Engineering and Technology
Type
Lab Report
Showing Page:
1/6

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/6

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/6

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 6 pages?
Access Now
Unformatted Attachment Preview
UNIVERSITY OF ENGINEERING AND TECHNOLOGY IDBS ASSINGMENT NO 2 ABDUL ALI 18-SE-45 Q1) Find the highest, lowest, sum, and average salary of all employees. Label the columns Maximum, Minimum, Sum, and Average, respectively. Query: Select Max(Sal),Min(Sal),Sum(Sal),AVG(sal) from emp; Result: Q2) Modify the query above to display the minimum, maximum, sum, and average salary for each job type. Query: Select Max(Sal), Min(Sal),Sum(Sal),Avg(Sal) From Emp where job='CLERK'; Select Max(Sal),Min(Sal),Sum(Sal),Avg(Sal) From Emp Where Job='SALESMAN'; Select Max(Sal),Min(sal),Sum(sal),Avg(sal) From Emp Where Job='ANALYST'; Select Max(Sal),Min(sal),Sum(sal),Avg(sal) From Emp Where Job='MANAGER'; Select Max(Sal),Min(sal),Sum(sal),Avg(sal) From Emp Where Job='PRESIDENT'; RESULT (CLERK): RESULT (SALESMAN): RESULT (ANALYST): RESULT (MANAGER): RESULT (PRESIDENT): Q3) Write a query to display the number of people with the same job. Query: Select Job, Count(*) From Emp GROUP BY job; RESULT: Q4) List the department,details where at least two emps are working. Query: SELECT deptno,Count(*) From Emp Group By Deptno having count(*) >= 2; RESULT: LAB 12 TASKS Task 1) Which customers have not placed any orders for writer’s desks? Query: SELECT CUSTOMER_NAME FROM CUSTOMER_T WHERE CUSTOMER_ID NOT IN (SELECT CUSTOMER_ID FROM ORDER_T, ORDER_LINE, PRODUCT_T WHERE ORDER_T.ORDER_ID= Order_Line.Order_Id And ORDER_LINE.PRODUCT_ID = Product_T.ProductId AND PRODUCTDESCRIPTION='Writers Desk'); ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Similar Documents