Please answer only question 2 Thanks A table ALBUMS of your
Please answer only question 2. Thanks!
A table ALBUMS of your own (similar to the one used so far) as well as an index table that contains album id and individual words in a title. Be careful not to forget constraints. A user----written function that sanitizes a title, removing punctuation and replacing accented letters with their unaccented equivalent, and finally turning everything to the same case (upper or lower doesn\'t matter). You\'ll probably want to use the translate() PostgreSQL function. In your solution, you can use the following list for accented letters: and the following list for punctuation: A function that will take two parameters, an album id and a title, and will populate the table containing album id and words (after sanitizing the title). Your function will ignore one----letter words. A trigger on your ALBUMS table that uses the preceding functions to automatically index titles when they are inserted or updated (updates will delete and replace words associated with the previous version of the title). (Write 3 INSERT into ALBUMS statements that will help you show that your functions/trigger work as required (by subsequently executing a SELECT * on the index table).Solution
2A)
The PostgreSQL translate function is used to translate any character in the string by a character in replace_string.
The characters in replace_string is corresponding to the characters in matching_string.
The translate will happen when any character in the string matching with the character in the matching_string.
Syntax :
here those special characters are not returned.. but those accented letters will be replaced with accented letters.
Here i provided what i understood from the given question, the statements what i wrote above are may not work properly but i am sure that it may helpful to you.. atleast you can understand something from this..
