0
0
PostgreSQLquery~10 mins

UPPER, LOWER, INITCAP in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to convert the column 'name' to uppercase.

PostgreSQL
SELECT [1](name) FROM employees;
Drag options to blanks, or click blank then click option'
ATRIM
BUPPER
CINITCAP
DLOWER
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOWER instead of UPPER will convert text to lowercase.
Using INITCAP capitalizes only the first letter of each word.
2fill in blank
medium

Complete the code to convert the column 'city' to lowercase.

PostgreSQL
SELECT [1](city) FROM locations;
Drag options to blanks, or click blank then click option'
AINITCAP
BLTRIM
CLOWER
DUPPER
Attempts:
3 left
💡 Hint
Common Mistakes
Using UPPER will convert text to uppercase, not lowercase.
INITCAP capitalizes the first letter of each word, not all letters.
3fill in blank
hard

Fix the error in the code to capitalize the first letter of each word in 'title'.

PostgreSQL
SELECT [1](title) FROM books;
Drag options to blanks, or click blank then click option'
ARTRIM
BUPPER
CLOWER
DINITCAP
Attempts:
3 left
💡 Hint
Common Mistakes
Using UPPER capitalizes all letters, not just the first letter of each word.
Using LOWER converts all letters to lowercase.
4fill in blank
hard

Fill both blanks to convert 'description' to lowercase and trim spaces from the right.

PostgreSQL
SELECT [1]([2](description)) FROM products;
Drag options to blanks, or click blank then click option'
ARTRIM
BLOWER
CUPPER
DINITCAP
Attempts:
3 left
💡 Hint
Common Mistakes
Using UPPER instead of LOWER changes text to uppercase.
Using LTRIM removes spaces from the left, not the right.
5fill in blank
hard

Fill all three blanks to convert 'author' to uppercase, trim spaces from the left, and capitalize the first letter of each word.

PostgreSQL
SELECT [1]([2]([3](author))) FROM writers;
Drag options to blanks, or click blank then click option'
AINITCAP
BLTRIM
CUPPER
DLOWER
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing the order of functions causes unexpected results.
Using LOWER instead of UPPER changes text to lowercase.