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
Dhruv2301 55 years 10 Answers 2135 views Great Grand Master 0

Answers ( 10 )

  1. select * from table_name order by joining date, designation desc;

  2. select *
    from table_name
    order by joining_date, designation desc

  3. SELECT * FROM employees
    ORDER BY joining_date, designation DESC

  4. select * from employees
    order by joining_data, designation DESC

  5. select * from employees order by joining_data, designation desc;

  6. SELECT*FROM Employees
    ORDER BY Joining_Date, FIELD( Designation, ‘HR’,’Admin’,’Accountant’);

  7. SELECT*FROM Employees
    ORDER BY Joining_Date, FIELD( Designation, ‘HR’,’Admin’,’Accountant’);

  8. select *
    from table
    order by joining date asc, designation desc

  9. SELECT name from Employee
    order by Joining date, Designation DESC

Leave an answer

Browse
Browse