Lowe’s Interview Questions | Query III
Question
Name | Designation | Joining_Date | Salary |
Ashutosh Singla | HR | 2019-12-15 | 80,000 |
Chandan Garg | Admin | 2019-10-09 | 60,000 |
Himanshi Kaur | HR | 2019-03-13 | 75,000 |
Mohit Dharm | HR | 2019-05-27 | 85,000 |
Meena Batra | Accountant | 2019-07-11 | 50,000 |
Omkar Singh | Accountant | 2019-01-05 | 45,000 |
Pratham Garg | Admin | 2019-05-27 | 65,000 |
Rakesh Sharma | HR | 2018-06-30 | 75,000 |
Sharadha Gupta | Accountant | 2019-09-18 | 50,000 |
Arrange the employees with respect to their Joining date, most experienced employee coming on the top followed by others.
(Hint- In case of same date, preference should be HR>Admin>Accountant)
in progress
1
SQL
55 years
10 Answers
2135 views
Great Grand Master 0
Answers ( 10 )
select * from table_name order by joining date, designation desc;
select *
from table_name
order by joining_date, designation desc
SELECT * FROM employees
ORDER BY joining_date, designation DESC
select * from employees
order by joining_data, designation DESC
select * from employees order by joining_data, designation desc;
SELECT*FROM Employees
ORDER BY Joining_Date, FIELD( Designation, ‘HR’,’Admin’,’Accountant’);
SELECT*FROM Employees
ORDER BY Joining_Date, FIELD( Designation, ‘HR’,’Admin’,’Accountant’);
Sir, what is field can you explain me that?
select *
from table
order by joining date asc, designation desc
SELECT name from Employee
order by Joining date, Designation DESC