0
0
MySQLquery~30 mins

UPPER and LOWER in MySQL - Mini Project: Build & Apply

Choose your learning style9 modes available
Using UPPER and LOWER Functions in SQL
📖 Scenario: You work at a bookstore database. The store wants to standardize how author names are displayed in reports. Some names are in uppercase, some in lowercase, and some mixed. You will use SQL functions to convert all author names to uppercase or lowercase.
🎯 Goal: Create a table of authors, then write queries using UPPER() and LOWER() functions to display author names in uppercase and lowercase.
📋 What You'll Learn
Create a table called authors with columns id (integer) and name (varchar).
Insert three authors with exact names: 'Jane Austen', 'mark twain', 'GEORGE ORWELL'.
Write a query to select all author names converted to uppercase using UPPER().
Write a query to select all author names converted to lowercase using LOWER().
💡 Why This Matters
🌍 Real World
Standardizing text case in databases helps keep reports and user interfaces consistent and professional.
💼 Career
Database developers and analysts often need to clean and format text data using functions like UPPER and LOWER.
Progress0 / 4 steps
1
Create the authors table and insert data
Create a table called authors with columns id as integer and name as varchar(50). Then insert these three rows exactly: (1, 'Jane Austen'), (2, 'mark twain'), and (3, 'GEORGE ORWELL').
MySQL
Need a hint?

Use CREATE TABLE to make the table, then INSERT INTO to add rows.

2
Write a query to select author names in uppercase
Write a SQL query to select the name column from authors but convert all names to uppercase using the UPPER() function. Name the output column name_upper.
MySQL
Need a hint?

Use SELECT UPPER(name) AS name_upper FROM authors; to convert names to uppercase.

3
Write a query to select author names in lowercase
Write a SQL query to select the name column from authors but convert all names to lowercase using the LOWER() function. Name the output column name_lower.
MySQL
Need a hint?

Use SELECT LOWER(name) AS name_lower FROM authors; to convert names to lowercase.

4
Combine uppercase and lowercase queries
Write a SQL query to select the name column from authors and show two columns: one with names in uppercase called name_upper and one with names in lowercase called name_lower. Use UPPER() and LOWER() functions in the same query.
MySQL
Need a hint?

Use SELECT UPPER(name) AS name_upper, LOWER(name) AS name_lower FROM authors; to show both columns.