UPPER

The SQL UPPER function is a string function that is used to convert all the characters of a string expression to uppercase. This function is used to standardize text data in a database, making it easier to search and compare information.

Syntax

The syntax of the SQL UPPER function is as follows:

UPPER(string_expression)

Where string_expression is the string or character expression that you want to convert to uppercase.

Example

Here’s an example of how to use the SQL UPPER function in a SELECT statement:

SELECT 
UPPER(product_name) AS upper_name
FROM products;

In this example, the UPPER function is used to convert the product_name column of the products table to uppercase. The result of this query is a new column called upper_name, which contains the uppercase version of each product name.

It’s important to note that the SQL UPPER function only works with alphabetic characters, and it will not convert any non-alphabetic characters, such as numbers or punctuation marks, to uppercase.

In summary, the SQL UPPER function is a simple yet useful function that can be used to standardize text data in a database. It is easy to use and can be applied to any string or character expression, making it a valuable tool for database developers and administrators.