w3resource
ankara escort
malatya escort
SQLite exercises

SQLite Exercise: Get job ID and maximum salary of the employees where maximum salary is greater than or equal to $4000

Write a query to get the job ID and maximum salary of the employees where maximum salary is greater than or equal to $4000.

Sample table : employees


SQLite Code:

SELECT job_id, MAX(salary) 
FROM employees 
GROUP BY job_id 
HAVING MAX(salary) >=4000;

Output:

job_id      MAX(salary)
----------  -----------
AC_ACCOUNT  8300
AC_MGR      12000
AD_ASST     4400
AD_PRES     24000
AD_VP       17000
FI_ACCOUNT  9000
FI_MGR      12000
HR_REP      6500
IT_PROG     9000
MK_MAN      13000
MK_REP      6000
PR_REP      10000
PU_MAN      11000
SA_MAN      14000
SA_REP      11500
SH_CLERK    4200
ST_MAN      8200

Sqlite Online Editor


Structure of 'hr' database :

hr database

Improve this sample solution and post your code through Disqus.

Previous: Write a query to get the total salary, maximum, minimum, average salary of employees (job ID wise), for department ID 90 only.
Next: Write a query to get the average salary for all departments employing more than 10 employees.

What is the difficulty level of this exercise?

New Exercises:R Programming