Us03mabca03-Part-2 DBMS-1 Practical List
Us03mabca03-Part-2 DBMS-1 Practical List
Part-II : Weightage-60%
Practical based on US03MABCA02 : Database Management Systems-I
Records:
Page 1 of 8
Records:
Records :
deptno dname loc
10 Accounting New York
20 Research Dallas
30 Sales Chicago
40 Operations Boston
Page 2 of 8
TABLE NAME: emp
Records:
Page 3 of 8
Records :
Records :
Page 4 of 8
Records :
Records:
A_id d_id P_id T_id App_date Duration Status
201801 D02 P01 T01 01-DEC-18 20 C
201802 D03 P02 T02 12-OCT-18 35 C
201803 D04 P03 T03 26-DEC-18 30 W
201804 D08 P04 T04 01-JAN-18 25 C
201805 D01 P05 T05 11-SEP-18 40 C
201806 D05 P06 T06 23-SEP-18 45 C
201807 D04 P07 T07 16-JAN-18 55 W
201808 D07 P08 T08 12-NOV-18 40 W
201809 D06 P09 T09 16-NOV-18 35 C
201810 D04 P10 T03 03-JUL-18 30 W
201811 D01 P04 T05 01-DEC-18 50 C
201812 D07 P07 T08 30-OCT-18 25 W
Page 5 of 8
Assignment-3
Assignment-4
Assignment-5
Page 6 of 8
Assignment-6
Group by…having
1 Display total no. of employee working is each department.
2 Find total no. of salesman and clerk in each department.
3 Find maximum salary of emp in each department.
4 Display dname and average salary of each department.
5 Display jobwise commission.
6 Display total salary of clerk and analyst of each department.
7 Display ename , dnmae and deptno of employee whose maximum salary greater than
5000.
8 Display deptno and salary whose department have more than 2 employee
9 Display deptno and salary whose total salary of employee is lessthan 2000.
10 Display total no of patient citywise.
11 Display total no. of doctors for each specialization.
12 Display total no of male patient citywise.
13 Display total no. of doctors for eye specialization.
Assignment-7
Joins
1 Display ename and dname of employee who working in Accounting department.
2 Display deptno , dname and ename of employee in sales department whose sal>2000
3 Display ename, dname of emp in research department whose enmae start with ‘A’.
4 Display ename, dname and sal of emp working as ‘clerk’ or ‘salesman’.
5 Display dname, ename,deptn of emp hired before ’01-sep-81’,
6 Display treatment details with their charges.
7 Display patients name and their appointment date.
8 Display doctor name, specialization and their appointment date.
9 Display treatment details whose charges is greater than 500.
10 Display patients name and their appointment date whose appointment date in the
month of December.
11 Display doctor name , patient name and treatment details with their charges.
12 Display detailed list of appointments for dr. Dharmendra Patel.
13 Display patient name who was treted by Dr. Mehul Patel.
14 Display patient name whose treatment is not completed.
15 Display the age of all male patients who are presently undergoing treatment.
16 Display employee name with their manage name.
Page 7 of 8
Assignment-8
Assignment-9
Sub query
1 Display empno, ename and salary whose salary is same as ‘WARD’s salary.
2 Display empno, ename and job who are working in same as ‘Scott’.
3 List the treatment details which treated in anand.
4 Display patient name with age greater than 28 years and completed their treatment.
5 Display doctor name who have treated male patients.
Assignment 10 (View)
Table structure:
Dept11 (dept_id number(5) primary key, Emp11(emp_id number(3) primary key,
dept_name varchar2(20) not null) emp_name varchar2(20) not null,
emp_sal number(8,2),
dept_id number(5) references
dept)
1 WAQ to create a view having name “emp_vw” which contains emp_id, emp_name and
salary from emp table.
2 WAQ to add new records in “emp” table using “emp_vw” view.
3 WAQ to update salary of JOHN from 2000 to 5000.
4 WAQ to create a read only view having name “emp_ro_vw” which contains emp_id,
emp_name and salary.
5 WAQ to view having name which contains emp_name, emp_sal and dept_name from
dept and emp table.
Assignment 11 (sequence)
1 Create sequence “seq1to10” which is start with 1 and ends with 10.
2 Create sequence “seq_even” which is generates with even numbers
between 100 and 500.
3 Create sequence “seq_rev” in a way that produce Z-A repetitive.
4 Create sequence “seq_div3”, it generates the number which is divisible by
3 and numbers are between 3 and 23.
5 Create sequence “seq_5” which is generates the numbers between 5 and
250, it start with 5 increment by 5, end with 250, cache value 5 and also the
numbers are in order.
Page 8 of 8