Create Employee table using the following attributes (emp_id, ename, deptno, deptname, job, salary)
Find the employee names and their respective department names.
Query:
select ename, deptname
From employee;
Find the name of those employees who are earning more than 20,000
Query:
select ename
From employee
Where salary>20000
Find employee names who are working as clerk in CSE department.
Query:
select ename,
from employee
where job=’clerk’ AND deptname =’CSE’
Write a query to display the name and salary of employees earning more than 25000.
Query:
select name, salary
From employee
Where salary > 25000
Write a query to display the employee name and department number for employee number 5.
Query:
select name, dept_id
From employee
Where emp_id =5;
Write a query to display the name and salary for all the employees whose salary is not in the range of Rs 10000 and 15000.
Query:
select name, salary
From employee
Where salary NOT BETWEEN 10000 AND 15000
Write a query to display the name and department number of all the employees in department number 8 and 12 in an alphabetical order by name.
Query:
select name, dept_id
From employee
Where dept_id = 8 AND dept_id = 12
Order by name;
Write a query to display the employee name, job and joining date of employees joined between june 11, 2010 and july 15, 2010. Also order the result in ascending order of joining date.
Query:
select name, job, join_date
From employee
Where join_date BETWEEN ’11-Jun-2010’ AND ’15-Jun-2010’
Order by Join_Date
Write a query to display the name, job and salary of all the employees whose job is clerk or teacher and whose salary is not equal to 15000.
Query:
select name, job, salary
From employee
Where job=’clerk’ OR job=’Teacher’ AND Salary!=15000;
No comments:
Post a Comment