PostgreSQL String() Function: Find all the employees which first name contains all the uppercase letter
8. Write a query to find all the employees which first name contains all the uppercase letter.
Sample Solution:
Code:
SELECT *
FROM employees
WHERE first_name = UPPER(first_name);
Sample table: employees
Output:
pg_exercises=# SELECT * pg_exercises-# FROM employees pg_exercises-# WHERE first_name = UPPER(first_name); employee_id | first_name | last_name | email | phone_number | hire_date | job_id | salary | commission_pct | manager_id | department_id -------------+------------+-----------+---------------+--------------+------------+----------+---------+----------------+------------+--------------- 132 | TJ | Olson | not available | 650.123.8234 | 1987-07-19 | ST_CLERK | 2130.00 | 0.10 | 121 | 50 (1 row) (END)
Practice Online
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query to get the employee id, email id to discard the last three characters.
Next: Write a query to extract the last four characters of phone numbers.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- 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
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework