Sample Exam Questions
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/02
To obtain the length (in characters) of a string, use the function 'character_length'. It correctly counts the number of characters, even for multibyte characters. You can also use 'char_length' or 'length', which have the same functionality.
To obtain the length (in bytes) of a string, use the function 'octet_length'. The function 'byte_length' does not exist. For languages that involve multibyte characters, such as Japanese, the number of bytes per character varies depending on the type of encoding. However, the function returns the byte count according to the encoding of the database server.
There is a function called 'substring' that extracts a part of a string. There are several patterns for the arguments, but the standard usage is to specify from which character and how many characters to extract, using 'from' and 'for', as in option C.
replace is a function that replaces a specific character in a string. As in option D, you pass the substring to be replaced and the replacement string as arguments.
trim is a function that removes whitespace from both ends of a string. There are also functions like ltrim, which only removes leading whitespace, and rtrim, which only removes trailing whitespace. However, you can achieve the same effect as ltrim and rtrim by specifying 'leading' or 'trailing' as an argument to trim.
This is a question where you need to select the incorrect option, so the correct answer is B.
© EDUCO All Rights Reserved.