Posts

Showing posts with the label DATA BASE MANAGEMENT SYSTEM PRACTICALS

DATA BASE MANAGEMENT SYSTEM PRACTICALS | practical

Image
Experiment 1 Program 1: Delete duplicate row from the table. DELETE FROM DEPT WHERE DEPTNO IN (SELECT DEPTNO FROM DEPT          GROUP BY DEPTNO HAVING COUNT(DEPTNO)>1);   DELETE FROM emp A WHERE ROWID NOT IN(SELECT MIN(ROWID) FROM  emp WHERE A.DEPTNO=B.DEPTNO); OR DELETE FROM DEPT A WHERE ROWID NOT IN (SELECT MIN(ROWID) FROM  DEPT B WHERE A.DEPTNO=B.DEPTNO); Ques1:-Delete the row containing name Ram? Ques2:-Delete all the rows having same name more then once? Ques3:- Delete the row of employee whose name start with M? Experiment 2 Program 2: Display the alternate row from table. SELECT * FROM EMP WHERE ROWID IN(SELECT DECODE(MOD(ROWNUM,2),0,ROWID) FROM EMP); OR SELECT * FROM GDEPT WHERE ROWID IN(SELECT DECODE(MOD(ROWNUM,2),0,ROWID) FROM GDEPT); Ques1:-Show the name of those employees who earn commission? Ques2:-Show all employees who has no commission but have a10% hike in their salary? Ques3:-Show...