0
0
MySQLquery~5 mins

UPPER and LOWER in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the UPPER() function do in MySQL?
The UPPER() function converts all letters in a string to uppercase letters.
Click to reveal answer
beginner
What is the purpose of the LOWER() function in MySQL?
The LOWER() function converts all letters in a string to lowercase letters.
Click to reveal answer
beginner
How would you convert the string 'Hello World' to all uppercase using MySQL?
Use the query: SELECT UPPER('Hello World'); which returns 'HELLO WORLD'.
Click to reveal answer
beginner
How can you convert a column named 'name' to lowercase in a SELECT query?
Use: SELECT LOWER(name) FROM table_name; This returns the 'name' values all in lowercase.
Click to reveal answer
intermediate
Why might you use UPPER() or LOWER() functions when comparing strings in SQL?
To make string comparisons case-insensitive by converting both strings to the same case before comparing.
Click to reveal answer
What will SELECT UPPER('mysql') return?
A'mysql'
B'mYsQl'
C'Mysql'
D'MYSQL'
Which function converts all letters in a string to lowercase in MySQL?
ALOWCASE()
BUPPER()
CLOWER()
DTOLOWER()
How would you write a query to select all names in uppercase from a table called users?
ASELECT name FROM users WHERE UPPER(name);
BSELECT UPPER(name) FROM users;
CSELECT LOWER(name) FROM users;
DSELECT TOUPPER(name) FROM users;
If you want to compare two strings ignoring case, what should you do?
AEither A or B
BUse LOWER() on both strings before comparing
CUse UPPER() on both strings before comparing
DNo need to change case
What does SELECT LOWER('HELLO WORLD'); return?
A'hello world'
B'hElLo WoRlD'
C'Hello World'
D'HELLO WORLD'
Explain how UPPER() and LOWER() functions work in MySQL and give an example of each.
Think about changing letter cases in words.
You got /4 concepts.
    Why is it useful to use UPPER() or LOWER() when comparing text data in SQL?
    Consider comparing 'Apple' and 'apple'.
    You got /3 concepts.