0% found this document useful (0 votes)
94 views7 pages

ADD SQL Questions

Display the names of all employees who are working in department number 10 or 20 or 40 or employees working as clerks, salesman or analyst and drawing a salary more than 3000. Display names of employees who have joined the company before 30 th june 90 or after 31 st dec 90.

Uploaded by

vika22
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views7 pages

ADD SQL Questions

Display the names of all employees who are working in department number 10 or 20 or 40 or employees working as clerks, salesman or analyst and drawing a salary more than 3000. Display names of employees who have joined the company before 30 th june 90 or after 31 st dec 90.

Uploaded by

vika22
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

[Link] the dept information from department table [Link] the details of all employees 3.

Display the name and job for all employees [Link] name and salary for all employees [Link] employee number and total salary for each employee [Link] employee name and annual salary for all employees [Link] the names of all employees who are working in department number 10 [Link] the names of all employees working as clerks and drawing a salary more than 3000 [Link] employee number and names for employees who earn commission [Link] names of employees who do not earn any commission [Link] the names of employees who are working as clerk , salesman or analyst and drawing a salary more than 3000 [Link] the names of employees who are working in the company for the past 5 years [Link] the list of employees who have joined the company before 30 th june 90 or after 31 st dec 90 [Link] current date [Link] the list of users in your database (using log table) [Link] the names of all tables from the current user [Link] the name of the current user [Link] the names of employees working in department number 10 or 20 or 40 or employees working as clerks , salesman or analyst [Link] the names of employees whose name starts with alphabet S [Link] employee name from employees whose name ends with alphabet S [Link] the names of employees whose names have sencond alphabet A in their names [Link] the names of employees whose name is exactly five characters in length [Link] the names of employees who are not working as managers [Link] the names of employees who are not working as SALESMAN or CLERK or ANALYST [Link] all rows from emp table. The system should wait after every screen full of information [Link] the total number of employees working in the company [Link] the total salary and total commission to all employees [Link] the maximum salary from emp table [Link] the minimum salary from emp table [Link] the average salary from emp table [Link] the maximum salary being paid to CLERK [Link] the maximum salary being paid in dept no 20 [Link] the minimum salary being paid to any SALESMAN [Link] the average salary drawn by managers [Link] the total salary drawn by analyst working in dept no 40 [Link] the names of employees in order of salary i.e. the name of the employee earning lowest salary shoud appear first [Link] the names of employees in descending order of salary [Link] the details from emp table in order of emp name

[Link] empnno,ename,deptno and sal. Sort the output first based on name and within name by deptno and witdhin deptno by sal; 40) Display the name of employees along with their annual salary(sal*12). the name of the employee earning highest annual salary should appear first? 41) Display name,salary,Hra,pf,da,TotalSalary for each employee. The out put should be in the order of total salary ,hra 15% of salary ,DA 10% of salary .pf 5% salary Total Salary will be (salary+hra+da)-pf? 42) Display Department numbers and total number of employees working in each Department? 43) Display the various jobs and total number of employees working in each job group? 44)Display department numbers and Total Salary for each Department? 45)Display department numbers and Maximum Salary from each Department? 46)Display various jobs and Total Salary for each job? 47)Display each job along with min of salary being paid in each job group? 48) Display the department Number with more than three employees in each department? 49) Display various jobs along with total salary for each of the job where total salary is greater than 40000? 50) Display the various jobs along with total number of employees in each [Link] output should contain only those jobs with more than three employees? 51) Display the name of employees who earn Highest Salary? 52) Display the employee Number and name for employee working as clerk and earning highest salary among the clerks? 53) Display the names of salesman who earns a salary more than the Highest Salary of the clerk? 54) Display the names of clerks who earn a salary more than the lowest Salary of any salesman? 55) Display the names of employees who earn a salary more than that of jones or that of salary greater than that of scott? 56) Display the names of employees who earn Highest salary in their respective departments? 57) Display the names of employees who earn Highest salaries in their respective job Groups? 58) Display employee names who are working in Accounting department? 59) Display the employee names who are Working in Chicago? 60) Display the job groups having Total Salary greater than the maximum salary for Managers? 61) Display the names of employees from department number 10 with salary greater than that of ANY employee working in other departments? 62) Display the names of employees from department number 10 with salary greater than that of ALL employee working in other departments? 63) Display the names of mployees in Upper Case? 64) Display the names of employees in Lower Case? 65) Display the names of employees in Proper case? 66) Find the length of your name using Appropriate Function? 67) Display the length of all the employee names? 68) Display the name of employee Concatinate with Employee Number?

69) Use appropriate function and extract 3 characters starting from 2 characters from the following string 'Oracle' i.e., the out put should be ac? 70) Find the first occurance of character a from the following string Computer Maintenance Corporation? 71) Replace every occurance of alphabet A with B in the string .Alliens (Use Translate function)? 72) Display the information from the employee table . where ever job Manager is found it should be displayed as Boss? 73) Display empno,ename,deptno from tvsemp table. Instead of display department numbers display the related department name(Use decode function)? , 74) Display your Age in Days? 75) Display your Age in Months? 76) Display current date as 15th August Friday Nineteen Nienty Seven? 77) Display the following output for each row from tvsemp table? 78) Scott has joined the company on 13th August ninteen ninety? 79) Find the nearest Saturday after Current date? 80) Display the current time? 81) Display the date three months before the Current date? 82) Display the common jobs from department number 10 and 20? 83) Display the jobs found in department 10 and 20 Eliminate duplicate jobs? 84) Display the jobs which are unique to department 10? 85) Display the details of those employees who do not have any person working under him? 86) Display the details of those employees who are in sales department and grade is 3? 87) Display thoes who are not managers? 88) Display those employees whose name contains not less than 4 characters? 89) Display those department whose name start with"S" while location name ends with "K"? 90) Display those employees whose manager name is Jones? 91) Display those employees whose salary is more than 3000 after giving 20% increment? 92) Display all employees with their department names? 93) Display ename who are working in sales department? 94) Display employee name,dept name,salary,and commission for those sal in between 2000 to 5000 while location is Chicago? 95) Display those employees whose salary is greater than his managers salary? 96) Display those employees who are working in the same dept where his manager is work? 97) Display those employees who are not working under any Manager? 98) Display the grade and employees name for the deptno 10 or 30 but grade is not 4 while joined the company before 31-DEC-82? 99) Update the salary of each employee by 10% increment who are not eligible for commission? 100) Delete those employees who joined the company before 31-Dec-82 while their department Location is New York or Chicago?

101) Display employee name ,job,deptname,loc for all who are working as manager? 102) Display those employees whose manager name is jones and also display their manager name? 103) Display name and salary of ford if his salary is equal to hisal of his grade? 104) Display employee name ,job,deptname,his manager name ,his grade and make an under department wise? 105) List out all the employee names ,job,salary,grade and deptname for every one in a company except 'CLERK' . Sort on salary display the highest salary? 106) Display employee name,job abd his manager .Display also employees who are with out managers? 107) Display Top 5 employee of a Company? 108) Display the names of those employees who are getting the highest salary? 109) Display those employees whose salary is equal to average of maximum and minimum? 110) Select count of employees in each department where count >3? 111) Display dname where atleast three are working and display only deptname? 112) Display name of those managers name whose salary is more than average salary of Company? 113) Display those managers name whose salary is more than average salary salary of his employees? 114) Display employee name,sal,comm and netpay for those employees whose netpay is greater than or equal to any other employee salary of the company? 115) Display those employees whose salary is less than his manager but more than salary of other managers? 116) Display all employees names with total sal of company with each employee name? 117) Find the last 5(least) employees of company? 118) Find out the number of employees whose salary is greater than their managers salary? 119) Display the manager who are not working under president but they are working under any other manager? 120) Delete those department where no employee working? 121) Delete those records from emp table whose deptno not available in dept table? 122) Display those enames whose salary is out of grade available in salgrade table? 123) Display employee name,sal,comm and whose netpay is greater than any othere in the company? 124) Display name of those employees who are going to retire 31-Dec-99 if maximum job period is 30 years? 125) Display those employees whose salary is odd value? 126) Display those employees whose salary contains atleast 3 digits? 127) Display those employees who joined in the company in the month of Dec? 128) Display those employees whose name contains A?

129) Display those employees whose deptno is available in salary? 130) Display those employees whose first 2 characters from hiredate - last 2 characters sal? 131) Display those employeess whose 10% of salary is equal to the year joining? 132) Display those employees who are working in sales or research? 133) Display the grade of jones? 134) Display those employees who joined the company before 15th of the month? 135) Display those employees who has joined before 15th of the month? 136) Delete those records where no of employees in particular department is less than 3? 137A) Delete those employeewho joined the company 10 years back from today? 137B) Display the deptname the number of characters of which is equal to no of employee in any other department? 138) Display the deptname where no employee is working? 139) Display those employees who are working as manager? 140) Count th number of employees who are working as managers (Using set opetrator)? 141) Display the name of the dept those employees who joined the company on the same date? 142) Display those employees whose grade is equal to any number of sal but not equal to first number of sal? 143) Count the no of employees working as manager using set operation? 144) Display the name of employees who joined the company on the same date? 145) Display the manager who is having maximum number of employees working under him? 146) List out the employee name and salary increased by 15% and express as whole number of Dollars? 147) Produce the output of the emptable "EMPLOYEE_AND JOB" for ename and job ? 148) List of employees with hiredate in the format of 'June 4 1988'? 149) print list of employees displaying 'Just salary' if more than 1500 if exactly 1500 display 'on taget' if less than 1500 display below 1500? 150) Which query to calculate the length of time any employee has been with the company Ans: select hiredate,to_char(hiredate,' HH:MI:SS') FROM tvsemp 151) Given a string of the format 'nn/nn' . Verify that the first and last 2 characters are numbers .And that the middle character is '/' Print the expressions 'Yes' IF valid 'NO' of not valid . Use the following values to test your solution'12/54',01/1a,'99/98'? 152) Employes hire on OR Before 15th of any month are paid on the last friday of that month those hired after 15th are paid the last friday of th following month .print a list of employees .their hiredate and first pay date sort those who se salary contains first digit of their deptno? 153) Display those managers who are getting less than his employees salary? 154) Print the details of employees who are subordinates to BLAKE? [Link] those who working as manager using co related sub query [Link] those employees whose manager name is JONES and also with his manager name

[Link] variable representing the expressions used to calculate on employees total annual renumaration define emp_ann_sal=(sal+nvl(comm,0))*.12; [Link] the variable in a statement which finds all employees who can earn 30000 a year or more [Link] out how many managers are there with out listing them [Link] out the avg sal and avg total remuneration for each job type remember salesman earn commission [Link] whether all employees number are indeed unique [Link] out the lowest paid employees working for each manager, exclude any groups where minsal is less than 1000 sort the output by sal [Link] ename,job,annual sal,depno,dname and grade who earn 30000 per year and who are not clerks [Link] out th job that was falled in the first half of 1983 and the same job that was falled during the same period on 1984 [Link] out the all employees who joined the company before their manager [Link] out the all employees by name and number along with their manager's name and number also display 'NO MANAGER' who has no manager [Link] out the employees who earned the highest sal in each job typed sort in descending sal order [Link] out the employees who earned the min sal for their job in ascending order [Link] out the most recently hired employees in each dept order by hire date [Link] ename,sal and deptno for each employee who earn a sal greater than the avg of their department order by deptno [Link] the department where there are no employees [Link] the dept no with highest annual remuneration bill as compensation [Link] which year did most people join the company. Display the year and number of employees [Link] avg sal figure for the dept [Link] a query of display against the row of the most recently hierd [Link] ename hire date and column max date showing [Link] employees who can earn more than lowest sal in dept no 30 [Link] employees who can earn more than every employees in dept no 30 [Link] dept name and deptno and sum of sal break on deptno on dname; [Link] out avg sal and avg total remainders for each job type [Link] all dept's which have more than 3 employees [Link] the pay day is next Friday after 15th and 30th of every month. What is the next pay day from their hire date for employee in emp table [Link] an employee is taken by you today in your organization and is a policy in your company to have a review after 9 months the joined date (and of 1st of next month after 9 months) how many days from today

your employee has to wait for a review [Link] employee name and his sal whose sal is greater than highest avg of deptno [Link] the 10 th record of emp table (without using rowid) [Link] the half of the enames in upper case and remaining lower case [Link] the 10th record of emp table without using group by and rowid [Link] the 10th record of emp table [Link] a copy of emp table [Link] ename if ename exists more than once [Link] all enames in reverse order [Link] those employee whose joining of month and grade is equal [Link] those employee whose joining date is available in deptno [Link] those employee name as follows A ALLEN, B BLAKE [Link] out the employees ename,sal,pf from emp [Link] RSPS from emp without using updating,inserting [Link] table emp with only one column empno [Link] this column to emp table ename varchar2(20) [Link] i forget to give the primary key constraint. Add it now [Link] increase the length of ename column to 30 characters [Link] salary column to emp table 197.I want to give a validation saying that sal can not be greater 10000(note give a name to this column) [Link] the time being i have decided that i will not impose this validation. My boss has agreed to pay more than 10000 [Link] boss has changed his mind. Now he doesn't want to pay more than 10000 So revoke that salary constraint [Link] column called as mgr to your emp table [Link]! This column should be related to empno, Give a command tdo add this constraint [Link] dept no column to your emp table [Link] deptno column should be related to deptno column of dept table [Link] table called as new emp. Using single command create this table as well as to get data into this table (use create table as) [Link] table called as newemp. This table should contain only empno,ename,dname [Link] the rows of employees who are working in the company for more than 2 years [Link] a commission to employees who are not earning any commission [Link] any employee has commission his commission should be incremented by 100% of his salary [Link] employee name and department name for each employee [Link] employee number,name and location of the department in which he is working [Link] ename,dname even if there no employees working in a particular department(use outer join) [Link] employee name and his manager name. [Link] the department name along with total salary in each department [Link] the department name and total number of employees in each department

You might also like