WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

SQL UCASE() Function


UCASE () function

The UCASE () function converts the value of a field to uppercase.

SQL UCASE () syntax

SELECT UCASE (column_name) FROM table_name;

Syntax for SQL Server

SELECT UPPER (column_name) FROM table_name;


Demo database

In this tutorial, we will use the welookups sample database.

Here is the data from the "Websites" table:

+----+--------------+---------------------------+-------+---------+
| id | name         | url                       | alexa | country |
+----+--------------+---------------------------+-------+---------+
| 1  | Google       | https://www.google.cm/  | 1     | USA     |
| 2  | zomato          | https://www.zomato.com/ | 13    | IN      |
| 3  | indiamart      | http://www.indiamart.com/  | 4689  | IN      |
| 4  | Yahoo          | http://Yahoo.com/       | 20    | IN      |
| 5  | Facebook     | https://www.facebook.com/| 3     | USA     |
| 7  | stackoverflow | http://stackoverflow.com/|   0 | IND     |
+----+---------------+---------------------------+-------+---------+


SQL UCASE () instance

The following SQL statement selects the "name" and "url" columns from the "Websites" table and converts the value of the "name" column to uppercase:

Example

SELECT UCASE(name) AS site_title, url
FROM Websites;

The result of executing the above SQL is as follows: