11. List employees in the Finance or Marketing department.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

12. Show employees whose names start with 'S'.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

13. Find employees with a Salary between 45000 and 52000.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

14. Display employees who do not belong to the HR department.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

15. Count employees in each department.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

16. Retrieve the minimum salary in the table.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

17. Show employees who joined in 2020 or later.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

18. List employees ordered by Joining_Date in descending order.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

19. Retrieve employees whose salary is not equal to 50000.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

20. Calculate the sum of all employees' salaries.

Code In Sql

-- Table Name : Employees -- ID | Name | Department | Salary | Joining_Date -- ----+---------+------------+--------+-------------- -- 1 | Rajesh | IT | 50000 | 2020-01-10 -- 2 | Sneha | HR | 45000 | 2019-04-12 -- 3 | Kiran | Finance | 52000 | 2021-08-23 -- 4 | Priya | Marketing | 48000 | 2018-06-15 -- 5 | Arjun | IT | 53000 | 2022-09-19 -- Your Query Here

Run Code?

Click Run Button to view compiled output

ad vertical

2 of 3