w3resource
SQL exercises

SQL Subquery Exercises: Display the full name,email, and designation for all those employees who was hired after the employee whose ID is 165

SQL SUBQUERY: Exercise-43 with Solution

Write a query in SQL to display the full name,email, and designation for all those employees who was hired after the employee whose ID is 165.

Sample table: employees


Sample Solution:

SELECT first_name ||' '|| last_name AS Full_Name , hire_date 
 FROM employees 
  WHERE hire_date > (
                     SELECT hire_date 
                       FROM employees 
                        WHERE employee_id = 165);

Sample Output:

full_name	hire_date
Steven Markle	2008-03-08
Sundar Ande	2008-03-24
Amit Banda	2008-04-21
Sundita Kumar	2008-04-21

Practice Online


Query Visualization:

Duration:

Query visualization of Display the full name,email, and designation for all those employees who was hired after the employee whose ID is 165 - Duration

Rows:

Query visualization of Display the full name,email, and designation for all those employees who was hired after the employee whose ID is 165 - Rows

Cost:

Query visualization of Display the full name,email, and designation for all those employees who was hired after the employee whose ID is 165 - Cost

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to display the first and last name, salary, and department ID for those employees who earn more than the minimum salary of a department which ID is 40.
Next: Write a query in SQL to display the first and last name, salary, and department ID for those employees who earn less than the minimum salary of a department which ID is 70.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming