Q: Retrieve DOB, Address From Table Employee Whose Fname Is Karan ?
Q: Retrieve DOB, Address From Table Employee Whose Fname Is Karan ?
ADDRESS
LNAME
ADDRESS
Grover
MANAGER
------------ -----------Ram
Ram
Jimmy
Jimmy
Prashant
Prashant
Karan
Karan
Raj
Raj
Q : Retrieve all ssn,dname using Cartesian product from employee and department table ?
SQL> select ssn,dname from employee,department;
SSN DNAME
---------- -----------1001 Marketing
1002 Marketing
1003 Marketing
1004 Marketing
1005 Marketing
1001 Account
1002 Account
1003 Account
1004 Account
1005 Account
1001 HR
1002 HR
1003 HR
1004 HR
1005 HR
1001 Sales
1002 Sales
1003 Sales
1004 Sales
1005 Sales
1001 Advt
1002 Advt
1003 Advt
1004 Advt
1005 Advt
SALARY SUPERSSN
DOB
AGE
DNO
---------- ---------- --------- ---------- ----------------- ----------- ---------------------------------------- ---------- --------------- ----------1005 Raj
15000
1005
04-APR-89
22
Q : Retrieve all employees in department 5 whose salary is between 10000 and 20000 ?
SQL> select * from employee where dno=5 and salary between 10000 and 20000;
SSN FNAME
MINIT
LNAME
ADDRESS
AGE
DNO
---------- ---------- --------- ---------- ---------------------- ------------- ---------------- ------ -------------- -----------------------------1005 Raj
Aggarwal
1005
04-APR-89
22
Q : Retrieve all details of employee whose salary > 20000 according to their department no. ?
SQL> select * from employee where salary>20000 order by dno;
SSN FNAME
MINIT
LNAME
ADDRESS
SALARY SUPERSSN
DOB
AGE
DNO
---------- ---------- --------- ---------- ------------------- ---------------- --------------------------- ---------------------- ---------------1003 Prashant
Arora
80000
1003
13-NOV-90
22
1002 Jimmy
Gupta
50000
1002
11-JAN-92
21
1004 Karan
Grover
24000
1004
07-MAR-85
28
Singh
22000
1001
11-NOV-83
30
1001 Ram
38200