Query Results

Run a query to see results.

Database Schema

Schema undefined.
Code Editor
Learn
Date, Number, and String Functions

Strings II

Another useful string function in SQL is REPLACE():

REPLACE(string,from_string,to_string)

The function returns the string string with all occurrences of the string from_string replaced by the string to_string.

For example in baked_goods, there is a column named ingredients. The ingredients strings are formatted with underscores, such as baking_soda and vanilla_extract. To make these values more readable, we might like to replace the underscores with spaces. We can do so by using the following query:

SELECT id, REPLACE(ingredients,'_',' ') as item_ingredients from baked_goods;
Report a Bug
If you see a bug or any other issue with this page, please report it here.