Tuesday, 23 June 2020

SQL Queries

1)Write a Query to display the employee details whose salary is equal to 10000
A: SELECT * FROM EMP WHERE SAL=10000

2)Write a query to change the deptno as „10‟whose employee id is 101
A: UPDATE EMP SET DEPTNO=10 WHERE EID=101

3)Write a query to delete a record whose employee id is 107
A: DELETE FROM EMP WHERE EID=107

4)  Nth Highest Salary

select * from Employee e1 where N-1 = (select count(distinct Salary) from Employee e2 where e2.Salary > e1.Salary )

No comments:

Post a Comment