0
0
SQLquery~5 mins

UPPER and LOWER functions in SQL - 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
What is the purpose of the LOWER function in SQL?
The LOWER function converts all letters in a text string to lowercase letters.
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
intermediate
How can you make a case-insensitive search using UPPER or LOWER?
Convert both the column and the search term to the same case using UPPER or LOWER, then compare them.
Click to reveal answer
beginner
If you apply LOWER to 'Hello World!', what is the result?
The result is 'hello world!'. Only letters change case; punctuation and spaces stay the same.
Click to reveal answer
What will SELECT UPPER('sql') return?
A'SQL'
B'sql'
C'Sql'
D'sQl'
Which function converts text to lowercase in SQL?
ALOWER()
BUPPER()
CLOWCASE()
DDOWN()
How can you compare two strings ignoring case differences?
ACompare strings directly without functions
BUse UPPER on both strings before comparing
CUse UPPER on one string only
DUse LOWER on one string only
What happens to numbers and punctuation when using UPPER or LOWER?
AThey change to uppercase or lowercase
BThey are removed
CThey stay the same
DThey cause an error
Which SQL function would you use to make 'Hello' into 'hello'?
AUPPER('Hello')
BCAPITALIZE('Hello')
CLOWCASE('Hello')
DLOWER('Hello')
Explain how UPPER and LOWER functions work in SQL and give an example of each.
Think about changing letter cases in text columns.
You got /4 concepts.
    Describe a real-life situation where using UPPER or LOWER in SQL would be helpful.
    Imagine searching names or emails without worrying about letter case.
    You got /3 concepts.