PostgreSQL Database Quiz Questions

Course Name:PostgreSQL
Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:STRING functions
Current Quiz Count:30
Progress
0%
Q1
True / False

In PostgreSQL, the length function can be used to determine the number of characters in a string.

Q2
True / False

The lower function in PostgreSQL converts all characters in a string to uppercase.

Q3
True / False

In PostgreSQL, the substring function extracts a substring from a string based on a specified start position and length.

Q4
True / False

PostgreSQL's trim function removes both leading and trailing spaces from a string by default.

Q5
True / False

The position function in PostgreSQL is used to find the position of the first occurrence of a substring within a string.

Q6
True / False

In PostgreSQL, the replace function can only replace a single character in a string.

Q7
True / False

The regexp_replace function in PostgreSQL allows for replacing parts of a string using a regular expression pattern.

Q8
True / False

PostgreSQL's initcap function capitalizes the first letter of each word in a string and converts the rest to lowercase

Q9
True / False

In PostgreSQL, the split_part function can split a string into an array based on a delimiter.

Q10
True / False

PostgreSQL supports the to_ascii function, which can convert non-ASCII characters to their ASCII equivalents.

Q11
Single Choice

Which PostgreSQL function is used to convert a string to lowercase?

Q12
Single Choice

What does the PostgreSQL function LENGTH('Hello World') return?

Q13
Single Choice

Which PostgreSQL function concatenates two strings 'Post' and 'greSQL'?

Q14
Single Choice

What is the output of the following PostgreSQL query?

SQL Code
SELECT SUBSTRING('PostgreSQL', 5, 4);
Q15
Single Choice

Which function removes all spaces from both ends of a string in PostgreSQL?

Q16
Single Choice

What is the result of the following PostgreSQL command?

SQL Code
SELECT POSITION('SQL' IN 'PostgreSQL Database');
Q17
Single Choice

How do you replace all occurrences of 'Post' with 'Pre' in the string 'PostgreSQL' using PostgreSQL?

SQL Code
SELECT REPLACE('PostgreSQL', 'Post', 'Pre');
Q18
Single Choice

What is the output of the following PostgreSQL query?

SQL Code
SELECT LPAD('SQL', 5, '*');
Q19
Single Choice

Which PostgreSQL function returns the number of bytes used to store the string 'PostgreSQL'?

Q20
Single Choice

What will be the result of the following PostgreSQL command?

SQL Code
SELECT INITCAP('postgresql string functions');
Q21
Multiple Choice

Which SQL queries correctly use the CONCAT function to combine two columns in PostgreSQL?

Q22
Multiple Choice

Which SQL queries correctly use the SUBSTRING function to extract a portion of a string in PostgreSQL?

Q23
Multiple Choice

Which SQL queries correctly use the LENGTH function to determine the length of a string in PostgreSQL?

Q24
Multiple Choice

Which SQL queries correctly use the TRIM function to remove spaces from a string in PostgreSQL?

Q25
Multiple Choice

Which SQL queries correctly use the REPLACE function to modify strings in PostgreSQL?

Q26
Multiple Choice

Which SQL queries correctly use the INITCAP function to capitalize the first letter of each word in PostgreSQL?

Q27
Multiple Choice

Which SQL queries correctly use the POSITION function to find the location of a substring in PostgreSQL?

Q28
Multiple Choice

Which SQL queries correctly use the LOWER and UPPER functions to change the case of strings in PostgreSQL?

Q29
Multiple Choice

Which SQL queries correctly use the LPAD and RPAD functions to pad strings in PostgreSQL?

Q30
Multiple Choice

Which SQL queries correctly use the SPLIT_PART function to split strings in PostgreSQL?