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

MySQL String Exercises: Find all employees where first names are in upper case

MySQL String: Exercise-8 with Solution

Write a query to find all employees where first names are in upper case.

Sample table: employees


Code:

SELECT * FROM employees 
WHERE first_name = BINARY UPPER(first_name);

Sample Output:

EMPLOYEE_ID	FIRST_NAME	LAST_NAME	EMAIL	PHONE_NUMBER	HIRE_DATE	JOB_ID		SALARY	COMMISSION_PCT	MANAGER_ID	DEPARTMENT_ID
132		TJ 		Olson		TJOLSON	 650.124.8234	1987-07-19T04:00:00.000Z ST_CLERK 2100	0		121		50

MySQL Code Editor:

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 (discard the last three characters).
Next:Write a query to extract the last 4 character of phone numbers.

What is the difficulty level of this exercise?