Challenge - 5 Problems
Case Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate1: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';
Attempts:
2 left
💡 Hint
UPPER converts all letters to uppercase.
✗ Incorrect
The UPPER function changes all letters in the string to uppercase, so 'Alice' becomes 'ALICE'.
❓ query_result
intermediate1: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';
Attempts:
2 left
💡 Hint
LOWER converts all letters to lowercase.
✗ Incorrect
The LOWER function converts all letters in the string to lowercase, so 'EleCtrOnics' becomes 'electronics'.
📝 Syntax
advanced2: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?Attempts:
2 left
💡 Hint
UPPER is a function that takes the column name as an argument inside parentheses.
✗ Incorrect
Option A uses the correct syntax: UPPER(column_name). Other options have syntax errors.
❓ optimization
advanced2: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?Attempts:
2 left
💡 Hint
Use LOWER on both sides to ensure case-insensitive comparison.
✗ Incorrect
Option D converts both the column and the string to lowercase, ensuring case-insensitive match efficiently. Option D works but only compares to uppercase string, which is less clear. Option D is case-sensitive. Option D uses LIKE with wildcards, which is less efficient.
🧠 Conceptual
expert2: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?
Attempts:
2 left
💡 Hint
Think about how text case affects searching and sorting.
✗ Incorrect
UPPER and LOWER are used to standardize text case so that comparisons and sorting are consistent regardless of original letter case. They do not encrypt data, convert numbers, or fix spelling.