Recall & Review
beginner
What does the UPPER function do in SQL?
The UPPER function converts all letters in a text string to uppercase letters.
Click to reveal answer
beginner
How does the LOWER function affect a string in SQL?
The LOWER function changes all letters in a text string to lowercase letters.
Click to reveal answer
beginner
Explain what INITCAP does to a string in SQL.
INITCAP capitalizes the first letter of each word in a string and makes all other letters lowercase.
Click to reveal answer
beginner
Write a SQL query to convert the column 'name' to uppercase.
SELECT UPPER(name) FROM table_name;
Click to reveal answer
beginner
What will be the output of INITCAP('hello WORLD')?
The output will be 'Hello World' because INITCAP capitalizes the first letter of each word and makes the rest lowercase.
Click to reveal answer
Which function converts all letters in a string to lowercase in PostgreSQL?
✗ Incorrect
LOWER converts all letters to lowercase.
What does INITCAP('good MORNING') return?
✗ Incorrect
INITCAP capitalizes the first letter of each word and makes the rest lowercase.
Which SQL function would you use to make a string all uppercase?
✗ Incorrect
UPPER converts all letters to uppercase.
If you apply LOWER to 'SQL DATABASE', what is the result?
✗ Incorrect
LOWER converts all letters to lowercase.
Which function capitalizes only the first letter of each word?
✗ Incorrect
INITCAP capitalizes the first letter of each word.
Describe the difference between UPPER, LOWER, and INITCAP functions in SQL.
Think about how each function changes the case of letters in a string.
You got /3 concepts.
Write example SQL queries using UPPER, LOWER, and INITCAP on a column named 'city'.
Use the function name followed by the column name in parentheses.
You got /3 concepts.