SQL Functions   «Prev 

SQL Function - Exercise Result

You entered:

Three SQL functions to provide Results

The SQL statement will use three different functions to provide the results you need. Once you have determined that you will be using the UPPER, LOWER, and LEN functions, the query is simple to set up.

SELECT 'Last Name' = UPPER(MyLastname),
'First Name' = LOWER(MyFirstname),
'Addr Length' = LEN(MyAddress)
FROM MyTable

This will return the three columns with the names you indicate. Of course, the column names you selected are less important than the fact that you named them correctly.

The statement for SQL Server and Oracle can be the same.
Select UPPER(name) as UPPERName, LOWER(name) 
as LOWERName from Customers; 

This instruction returns simultaneously the upper name and lower name of customers name.
The result of previous statement is shown in Figure 4-5

Figure 4-5: Displays the upper and lower names of the customers
Figure 4-5: Displays the upper and lower names of the customers