Exp 1
Exp 1
Aim:
To Explore various commands given in PL/SQL in Oracle8.0.
4. Display name and salary of employee whose department no is 20. Give alias name to name of
employee.
5. Display employee no,name and department details of thoseemployee whose department lies
in(10,20)
7. Display name, number and salary of those employees whose name is 5 characters long and first
three characters are ‘Ani’.
8. Display the non-null values of employees and also employee name second character should be ‘n’
and string should be 5 character long.
SELECT * FROM EMPLOYEE WHERE EMP_COMM IS NOT NULL AND EMP_NAME LIKE
‘__n__’;
9. Display the null values of employee and also employee name’s third character should be ‘a’.
10. What will be output if you are giving LIKE predicate as ‘%\_%’ ESCAPE‘\’
16. Create table supplier from employee with all the columns.
17. Create table sup1 from employee with first two columns.
19. Insert the data into sup2 from employee whose second charactershould be ‘n’ and string should
be 5 characters long in employee name field.
INSERT INTO SUP21 (EMP_NO) SELECT (EMP_NO) FROM EMPLOYEE WHERE
EMP_NAME LIKE '_____a_____';
24. Update the value dept_no to 10 where second character of emp. nameis ‘m’.
25. Update the value of employee name whose employee number is 103.
26. Find the average salaries for each department without displayingthe respective department
numbers.
27. Write a query to display the total salary being paid to each job title, within each
department.
28. Find the average salaries > 2000 for each department without displaying the respective
department numbers.