Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT PNo
- FROM PROJECT
- WHERE PNo IN(
- (SELECT P.PNo
- FROM PROJECT P,DEPARTMENT D ,EMPLOYEE E
- WHERE P.DNo=D.DNo AND D.MgrSSN=E.SSN AND E.Name='Scott')
- UNION
- (SELECT W.PNo
- FROM WORKS_ON W, EMPLOYEE E
- WHERE E.SSN=W.SSN AND E.Name='Scott'));
- SELECT E.Name,1.1* E.Salary AS Increased_salary
- FROM EMPLOYEE E, WORKS_ON W, PROJECT P
- WHERE E.SSN=W.SSN AND W.PNo=P.PNo AND P.PName='IoT';
- SELECT SUM (E. Salary) AS TOTAL_SALARY,MAX(E. Salary) AS
- MAX_SALARY,MIN(E. Salary) AS MIN_SALARY,AVG(E. Salary) AS
- AVG_SALARY
- FROM EMPLOYEE E, DEPARTMENT D
- WHERE E. DNo= D. DNo AND D.DName='Accounts';
- SELECT E.Name
- FROM EMPLOYEE E
- WHERE NOT EXISTS((SELECT PNo FROM PROJECT WHERE DNo='D5')
- MINUS (SELECT W.PNo FROM WORKS_ON W WHERE E.SSN=W.SSN));
- SELECT D.DNo,COUNT(*)
- FROM EMPLOYEE E, DEPARTMENT D
- WHERE E.DNo= D.DNo AND E.Salary>600000
- GROUP BY D.DNo
- HAVING COUNT(*)>=5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement