Documente Academic
Documente Profesional
Documente Cultură
Lab 2
Lab 3
Create table and populate the value given and provide solution file
deptnonumber(2,0),
dnamevarchar2(14),
locvarchar2(13),
empnonumber(4,0),
enamevarchar2(10),
jobvarchar2(9),
mgrnumber(4,0),
hiredate date,
salnumber(7,2),
commnumber(7,2),
deptnonumber(2,0),
order by ename
//Simple natural join between DEPT and EMP tables based on the primary
key of the DEPT table DEPTNO, and the DEPTNO foreign key in the EMP
table.
group by DNAME
order by 2 desc
//The GROUP BY clause in the SQL statement allows aggregate functions of
non grouped columns. The join is an inner join thus departments with no
employees are not displayed.
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
SAL NUMBER,
COMM NUMBER
( GRADE NUMBER,
LOSAL NUMBER,
HISAL NUMBER )
7. display the names of all employee who are working in department number
10
8. display the names of all employee working as clerks and drawing a salary
more than 3000
9. display employee number and names for employee who earns commission
11. display the names of employee who are working as clerk, salseman or
analyyst and drawimg a salary more than 3000
12. display the names of employee who are working in company for the past
5 years
13. display the list of employee who have joines the company before 30 june
90 or after 31 dec 90
17. display the names of employee whose names have second alphabet A in
their names
18. display the names of employee whose name is exactly five charactere in
length
28. display the names of employee in order of salary i.e the name of the
employee earning lowest salary should appear first
30. display the details from emp table in order of emp name
31. display empno ename deptno and sal. sort the output first based on
name and within name by deptno and within deptno by sal
32. display the name of the employee along with their annual salary
(sal*12) the name of the employee earning highest annual salary should
appear first
33. display name, sal, hra, pf, da, total sal for each employee. the output
shouldbe in the order oftotal sal, hra 15% of sal,da 10% of sal, pf 5%of sal
total salary will be (sal*hra*da)-pf
34. display dept number and total number of employees within each group
35. display the various jobs and total number of employee with each job
group
36. display department number and total salary for each department
37. display department number and maximum salary for each depatrment
38. display the various jobs and total salary for each job
39. display each job along with minimum sal being paid in each job group
40. display the department numbers with more than three employee in each
dept
41. display the various jobs along with total sal for each of the jobswhere
total sal is greater than 40000
41. display the various jobs along with total number of employee in each
job. the output should contain only those jobs with more than three
employee
43. display the employee number and name of employee working as cleark
and earning highest salary among clerks
44. display the names of clearkwho earn salary more than that of james of
that of sal lesser than that of scott
45. display names of employees who earns a sal more than that of james or
that of salary greater than that of scott
Lab 4
1.Create the tables in the Inventory database in Oracle and populate them
using the data given in Inventory_Mngt_create file
2.Validate the following by adding a check constraint while creating the table.
a)Accepted quantity cannot be above Received quantity
b)Received quantity cannot fall below 10
What to Deliver?
Note:
Theres a pdf
Lab 5