Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

SQLite Exercise: Find the employee ID, job title number of days between ending date and starting date for all jobs in department 90 from job history

Write a query to find the employee ID, job title number of days between ending date and starting date for all jobs in department 90 from job history.

Sample table : employees


SQLite Code:

SELECT employee_id, job_title, end_date-start_date Days FROM job_history 
NATURAL JOIN jobs 
WHERE department_id=90;

Output:

employee_id  		job_title			Days
---------- 		----------			-------
200			Administration Assistant	6
200			Public Accountant		4

Practice SQLite Online


Model Database

Employee Model  Database - w3resource online SQLite practice

Structure of 'hr' database :

hr database

Improve this sample solution and post your code through Disqus.

Previous: Write a query to get the department name and number of employees in the department.
Next: Write a query to display the department ID, department name, and manager first name.

What is the difficulty level of this exercise?