Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Experiment No.5:
Perform DML Operations and also construct database keys
Ans:
Query:
dname varchar2(10),
loc varchar2(20)
);
Output:
Query:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
values(1,'it','mumbai');
Output:
Query:
values(2,'com','pune')
Output:
Query:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
select *
from dept22;
Output;
Ans:
Query:
enam varchar2(10),
job varchar2(10),
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
sal number(2)
);
Output:
Query;
values(11,'mahesh','ap',1,10000);
values(12,'arjun','aps',2,12000);
values(13,'ganesh','aps',1,12000);
values(14,'kartik','pro',2,30000);
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
values(15,'aakash','ap',1,10000);
values(16,'suresh','lect',1,8000);
select *
from emp22
Output:
Q.3. Update the EMP table to set the salary of all employees to 15,000 who are working as ASP
Ans:
Query:
update emp22
set Sal=15000
where Job='ASP';
Output:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
Q.4. Create a pseudo table Employee with the same structure as the table EMP and insert rows
into the table using select clause
Ans:
Output:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
Query: select *
from Employee22;
Output:
Ans:
from emp22;
Output:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
Ans:
Query:
delete
from emp22
where job='lect'
Output:
Query:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
select *
from emp22
output:
Q.7. List the records in the EMP table order by salary in ascending order
Ans:
Query:
select *
from emp22
order by sal;
Output:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22
Q.8. List the records in the EMP table order by salary in descending order
Ans:
Query:
select *
from emp22
Output:
Ans:
select *
from emp22
where deptno=1;
Output:
Q.10. Display Deptno from the table EMP avoiding the duplicated values
Ans:
Query:
from emp22
Output:
Name: Deepak Maurya
Class: SE-IT Batch: A Roll No: 22