Complete the code to convert the string 'hello' to uppercase using a PostgreSQL function.
SELECT [1]('hello');
The UPPER function converts all letters in a string to uppercase.
Complete the code to find the position of the substring 'cat' in the string 'concatenate'.
SELECT POSITION([1] IN 'concatenate');
The POSITION function returns the starting position of the substring 'cat' in the string.
Fix the error in the code to extract the first 4 characters from the string 'PostgreSQL'.
SELECT SUBSTRING('PostgreSQL' [1] 4);
The correct syntax for SUBSTRING is SUBSTRING(string FROM start FOR length).
Fill both blanks to trim spaces from both ends of the string and convert it to lowercase.
SELECT [1]([2](' Hello World '));
First, TRIM removes spaces from both ends. Then, LOWER converts the string to lowercase.
Fill all three blanks to create a query that replaces 'day' with 'night' in the string, converts it to uppercase, and trims spaces.
SELECT [1]([2](REPLACE('Good day ', [3], 'night')));
The REPLACE function swaps 'day' with 'night'. Then UPPER converts to uppercase. Finally, TRIM removes spaces.
Note: The code applies REPLACE first, then UPPER, then TRIM.