SQL Exercise: List all the employees joined on 1st may 91
SQL employee Database: Exercise-27 with Solution
[An editor is available at the bottom of the page to write and execute the scripts.]
27. From the following table, write a SQL query to find the employees who joined on the 1st of May 1991. Return complete information about the employees.
Sample table: employees
Pictorial Presentation:
Sample Solution:
SELECT *
FROM employees
WHERE hire_date = '1991-05-01';
Sample Output:
emp_id | emp_name | job_name | manager_id | hire_date | salary | commission | dep_id --------+----------+----------+------------+------------+---------+------------+-------- 66928 | BLAZE | MANAGER | 68319 | 1991-05-01 | 2750.00 | | 3001 (1 row)
Explanation:
The said query in SQL that returns a list of all employees who were hired on May 1st, 1991, along with all of their information from the 'employees' table.
The WHERE clause filters the results to only include employees who were hired on May 1st, 1991.
Relational Algebra Expression:
Relational Algebra Tree:
Practice Online
Sample Database: employee
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous SQL Exercise: List the employee who are not working under a manager.
Next SQL Exercise: Experiences of all employees working with Manger 68319.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/sql-exercises/employee-database-exercise/sql-employee-database-exercise-27.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics