Beruflich Dokumente
Kultur Dokumente
Ename City
Anil Nagpur
Shankar Bombay
Jaya Madras
Sunil Bombay
Vijay Delhi
Prakash Calcutta
Ajay madras
Emp_company
Ename Ename Salary Jdate
Anil Acc 1500.00 01-may-89
Shankar Tata 2000.00 10-jul-90
Jaya Cmc 1800.00 07-jun-91
Sunil Cmc 1700.00 01-jan-88
Vijay Tata 5000.00 03-jan-88
Prakash Tata 3000.00 27-may-89
Ajay Acc 8000.00 30-apr-95
Amol Acc 1000.00 17-may-95
Company
Cname City
Acc Madras
Tata Bombay
Acc Nagpur
Cmc Bombay
Cmc Madras
Tata delhi
Manager
Ename Mname
Anil Ajay
Shankar Vijay
Jaya -
Sunil Jaya
Vijay -
Prakash Shankar
Ajay -
Emp_shift
Ename Shift
Anil A
Sunil B
Vijay B
Prakash C
Branch
Bname City
Vrce Nagpur
Ajni Nagpur
Karolbagu Delhi
Chandni Delhi
Dharampeth Nagpur
m.g.road Banglore
Andheri Bombay
Virar Bombay
Nehru place Delhi
Powai Bombay
Cutomer
Cname City
Anil Calcutta
Sunil Delhi
Mehul Baroda
Mandar Patna
Madhuri Nagpur
Pramod Nagpur
Sandip Surat
Shivani Bombay
Krinti Bombay
Naren bombay
Borrow
Loanno Cname Bname Amount
201 Anil Vrce 1000
206 Mehul Ajni 5000
311 Sunil Dharampeth 3000
321 Madhuri Andheri 2000
375 Pramod Virar 8000
481 Kranti Nehru place 3000
Aggregate funcations :
Update Statements :
Delete Statement :
1. delete from customer
2. delete depositors of branches having number of customers between 1 and 3
3. delete branches having average deposit less than 5000
4. delete branches having maximum loan more than 5000
5. delete branches having deposit from NAGPUR
6. delete deposit of ANIL and SUNIL if both are having branch VIRAR
7. delete deposit of ANIL and SUNIL if both are having living city NAGPUR
8. delete deposit of ANIL and SUNIL if both are having the same living city
9. delete deposit of ANIL and SUNIL if they are having less deposit than VIJAY
10. delete deposit of VIJAY
11. delete deposit of AJAY if VIJAY is not a depositor
12. delete customers from BOMBAY city
13. delete depositors if the branch is VIRAR and depositor name is AJAY
14. delete depositors having deposit less than 500
15. delete borrower having loan more than 10000
16. delete borrower having loan more than 1000 and branch KAROLBAGH
17. delete the names of those depositors of VRCE branch who live in the city BOMBAY
18. delete borrower having branch name CHANDHI
19. delete borrower of branches having average loan less than 1000
20. delete borrower of branches having the minimum number of customers
Set operators :
1. list all the customers who are depositors but not borrowers
2. list all the customers who are both depositors and borrowers
3. list all the customers along with their amount who are either borrowers or depositors and living in city NAGPUR
4. list all the depositors having deposit in all the branches where SUNIL is having account
5. list all the customers living in city NAGPUR and having branch city BOMBAY or DELHI
6. list all the depositors living in city NAGPUR
7. list all the depositors living in NAGPUR and having branch in city DELHI
8. list the branch cities of ANIL and SUNIL
9. list the customer having deposit greater than 1000 and loan less than 10000
10. list the borrowers having branch city same as that of SUNIL
11. list the cities of depositors having branch VRCE
12. list the depositors having the same living city as that of SUNIL and the same branch city as that of ANIL
13. list the depositors having amount less than 8000 and living in the same city as Ms. SHIVANI
14. list all the customers who are both depositors and borrowers and living in the same city as ANIL
15. list all the cities where branches of ANIL and SUNIL are located
16. list all the customer names and the AMOUNT for depositors living in the city where either ANIL or SUNIL is
living
17. list the amount for the depositors living in the city where ANIL is living
18. list the cities which are either branch city of ANIL or living city of SUNIL
19. list the customers who are borrowers or depositors and having living city BOMBAY and branch city same as that
of SANDIP
20. list the customers who are both borrowers and depositors and having the same branch city as that of ANIL
1. Display empno, ename, sal ,annual sal, daily sal from all employees in the descending order of daily
salary ?
2. Display empno,ename, joining date, current date, experience of all employees in desc of experience
3. Display empno,ename, joining date, current date, experience show in years of all employees in desc of
experience
4. Display empno,ename, ta, da, hra, total , gross salary, of all the employees in desc order of gross
salary
5. Display the details of clerks
6. Display details of ename of scott
7. list the employees whose sal is more than 2500
8. list the employees whose joined after year 98
9. Display the employees whose experience more than 26 years
10. Display the details of all the employee receiving a daily salary less then 50
11. Display all the details with experience > 26
12. Display the employee details working for the deptno 30 ? in the desc order by job
13. Display all the employees joined before 1st –MAY-194
14. Display all the analysts & Managers
15. Display the details of blake, king, james, john’s adams, and killer
16. Display the details of all the employees joined on 17-nov-1981 , 03-dec-1981, 09-jun-1981
17. Display the details of all the employees whose salary is ranging from 1500 to 3250 (write 2 methods )
18. Display the details of all the employees in desc order of their salary of those joining in the year 1981
19. Display the details of manager along with exp of those having ranges from 26 to 27
20. Display the details of all the employees receiving no comm.
21. Display the details of all the employees receiving the comm.
22. Display the details off all the employees joined after 2nd quarter of 1982
23. Display all 4 character names
24. Display all the 5 character names begin with ‘S’
25. Display all the names having character ‘A’
26. List all the names ending with character ‘N’
27. List all the employees joined in month which started with character ‘A’
28. Display the details of all 4 digits salary employees
29. Display all the table names having a character underscore in the name
30. Display all the table names of having percentile character in the name
31. Display all the table names of having space character in the name
32. Display the details of all the manages of dept 10,20,30
33. Display all the salesman of deptno 30 receiving some comm.
34. Display the details of all analyst having exp more than 25 years receiving a salary which is more than
2000 & not receiving any comm. In the desc order of hiredate
35. Display the details of all the employees of dept 10 & 20 joined before 1983, with sal more than 1300 &
less than 3500 and not belongs to the month December working under some manager with out comm.
Or who belongs to dept 30 working as salesman with sal more than 800 joined in the year 1981 & name
of the employee not starts with character ‘A’ in the ascending order of deptno
36. Display empno, ename, sal daily sal, rounded to the nearest integer annual sal rounded to the nearest
100, experience with 2 decimal places of all the employees
37. Display the details of all the employees along with daily sal of those receiving a dsal without
any decimal places
38. Display empno, ename, sal, comm., sal or comm. Which even in high sal or comm. Which ever is low
for all the employees.
39. Display all the salaries those are divisible by 1000
40. Display all the even number salaries
41. Display all 6 charactered named employees
42. Display the emp names those are starting with ‘S’ and 5 characters length and 3rd character is ‘O’ and
last character is ‘T’
43. Display all enames having a char eighter a,e,I,o,u in the 3rd position of name
44. Display empno,ename, sal, dailysal, of all employees in the descending order of their daily salary
Projection : Retrieving the data from the specific columns of table is called projection
Alias : means giving a temporary heading to column during the data display is called columns alias
1. Display empno, ename, sal, job of all employees descriptive line headings (use “as” also)
Order by clause : sorting the output (default sort order is asc / desc)
Syntax :
1. Display details of employee in the descending order of their salaries
2. Display details of employee in the descending order of their experience
3. Display deptno, job, empno, sal , of all the employees in the ascending order of deptno & in desc order
of job (1,2)
4. Display all the unique jobs in ascending order
5. Display all the commission in descending order
Decode( ) :
Decode works on any datatype but all parameters should belongs to same datatype
Case( ) :
1. Display details of employees if current day of month is lessthan 15 then consider the total days of
lastmonth otherwise totaldays of present month