Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Prog grd12

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

John want to know how many employees receiving salary below 10,000.

What SQL command he need to run?


- SELECT COUNT(*) FROM employees WHERE salary < 10000;

Evaluate the following SQL command


SELECT employee_id, salary, department_id FROM employees WHERE department_id IN (60,70)
- The SQL command will display employees with department id 60 or 70.

You want to display the employee's last name and date hired in year 2000 to2006 whose salary is
above 5000. Which SQL statement give the required output?
- SELECT last_name, hire_date FROM employees WHERE hire_date>= 
TO_DATE('01-Jan-2006', 'DD-Mon-RR') AND hire_date<= TO_DATE('31-Dec-2006', 'DD-Mon-RR') AND
salary > 5000;

List all employees except for IT_PROG job id.


- All of the choices

Evaluate the following SQL command


SELECT employee_id, min_salary, max_salary FROM employees, departments WHERE
salary>= 10000 && salary <= 20000
- The SQL command will produce an error.

Display all the records in the employee table. Arrange the output in by lastname from A-Z order.
- SELECT * FROM employees ORDER BY lastname

Display employee's name and id whose firstname starts with letter D and job id is IT_PROG. 

Sort the output by department.


- SELECT employee_id, first_name, last_name FROM employees WHERE first_name LIKE 'D%' and job_id
= 'IT_PROG' ORDER BY department_id

You what to generate the average salary of all employees whose job function is FI_ACCOUNT. 

Which of the following SQL command will produce the output.


- SELECT AVG(salary) FROM employees WHERE job_id = 'FI_ACCOUNT';

Display all location id between 1000 to 2000.


- SELECT location_id FROM departments WHERE location_id BETWEEN 1000 AND 2000

What will be the SQL command if every employee will be given a productivity bonus which is equivalent
to 3% of the monthly salary?
Display the employee id, salary and the productivity bonus.

You might also like