SQL exercises on employee Database: List the employees who joined in the month of which second character is 'a'
SQL employee Database: Exercise-108 with Solution
[An editor is available at the bottom of the page to write and execute the scripts.]
108. From the following table, write a SQL query to find those employees who joined in the month of where the second letter is 'a'. Return number of employees.
Sample table: employees
SELECT * FROM employees WHERE to_char(hire_date,'mon') LIKE '_a%';
emp_id | emp_name | job_name | manager_id | hire_date | salary | commission | dep_id --------+----------+----------+------------+------------+---------+------------+-------- 66928 | BLAZE | MANAGER | 68319 | 1991-05-01 | 2750.00 | | 3001 68736 | ADNRES | CLERK | 67858 | 1997-05-23 | 1200.00 | | 2001 69324 | MARKER | CLERK | 67832 | 1992-01-23 | 1400.00 | | 1001 (3 rows)
Sample Database: employee
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: From the following table, write a SQL query to find those employees whose name is six characters in length, starting with 'A' and ending with 'N'. Return number of employees.
Next: From the following table, write a SQL query to find those employees whose names contain the character set 'AR' together. Return complete information about the employees.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework