0
0
MySQLquery~20 mins

UPPER and LOWER in MySQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Case Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:30remaining
What is the output of the UPPER function?
Given the table Employees with a column name containing the value 'Alice', what will be the result of this query?
SELECT UPPER(name) FROM Employees WHERE name = 'Alice';
MySQL
SELECT UPPER(name) FROM Employees WHERE name = 'Alice';
Aalice
BError: function UPPER not found
CALICE
DAlice
Attempts:
2 left
💡 Hint
UPPER converts all letters to uppercase.
query_result
intermediate
1:30remaining
What does LOWER do to mixed case text?
Consider a table Products with a column category containing the value 'EleCtrOnics'. What is the output of this query?
SELECT LOWER(category) FROM Products WHERE category = 'EleCtrOnics';
MySQL
SELECT LOWER(category) FROM Products WHERE category = 'EleCtrOnics';
AEleCtrOnics
Belectronics
CELECtrONICS
DError: function LOWER not found
Attempts:
2 left
💡 Hint
LOWER converts all letters to lowercase.
📝 Syntax
advanced
2:00remaining
Which query correctly converts a column to uppercase?
You want to select the city column from the Customers table and convert all city names to uppercase. Which query is syntactically correct?
ASELECT UPPER(city) FROM Customers;
BSELECT city.UPPER() FROM Customers;
CSELECT UPPER city FROM Customers;
DSELECT city TO UPPER FROM Customers;
Attempts:
2 left
💡 Hint
UPPER is a function that takes the column name as an argument inside parentheses.
optimization
advanced
2:30remaining
Optimizing case-insensitive search using LOWER
You want to find all rows in the Users table where the email column matches 'Example@Domain.com' regardless of case. Which query is the most efficient and correct?
ASELECT * FROM Users WHERE UPPER(email) = 'EXAMPLE@DOMAIN.COM';
BSELECT * FROM Users WHERE email = 'Example@Domain.com';
CSELECT * FROM Users WHERE email LIKE '%Example@Domain.com%';
DSELECT * FROM Users WHERE LOWER(email) = LOWER('Example@Domain.com');
Attempts:
2 left
💡 Hint
Use LOWER on both sides to ensure case-insensitive comparison.
🧠 Conceptual
expert
2:00remaining
Why use UPPER or LOWER in database queries?
Which of the following best explains why you might use UPPER or LOWER functions in SQL queries?
ATo ensure case-insensitive comparisons and standardize text data for searching or sorting.
BTo encrypt sensitive data before storing it in the database.
CTo convert numeric data into string format for calculations.
DTo automatically fix spelling mistakes in text columns.
Attempts:
2 left
💡 Hint
Think about how text case affects searching and sorting.