0
0
PostgreSQLquery~5 mins

UPPER, LOWER, INITCAP in PostgreSQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AINITCAP
BUPPER
CLOWER
DTRIM
What does INITCAP('good MORNING') return?
A'Good Morning'
B'good morning'
C'gOOD mORNING'
D'GOOD MORNING'
Which SQL function would you use to make a string all uppercase?
AUPPER
BINITCAP
CLOWER
DCONCAT
If you apply LOWER to 'SQL DATABASE', what is the result?
A'SQL DATABASE'
B'sQL dATABASE'
C'Sql Database'
D'sql database'
Which function capitalizes only the first letter of each word?
ALOWER
BINITCAP
CUPPER
DLTRIM
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.