Aan de slagGa gratis aan de slag

Changing to lowercase and uppercase

Most of the time, you can't make changes directly to the data from the database to make it look more user-friendly. However, when you query the data, you can control the aspect of the results, and you can make them easier to read.

Working with functions that manipulate string values is easy and gives great results. In this exercise, you will see how easy it is to work with the functions that transform the characters from a string to lowercase or uppercase. The purpose is to create a message mentioning the types of cocoa beans used by each company and their country of origin: The company BONNAT uses beans of type "Criollo", originating from VENEZUELA .

Deze oefening maakt deel uit van de cursus

Functions for Manipulating Data in SQL Server

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT 
	company,
	bean_type,
	broad_bean_origin,
	'The company ' +  company + ' uses beans of type "' + bean_type + '", originating from ' + broad_bean_origin + '.'
FROM ratings
WHERE
    -- The 'broad_bean_origin' should not be unknown
	___ NOT LIKE '%unknown%';
Code bewerken en uitvoeren