The string function SOUNDEX() and its purpose in SQL.
The Soundex code was developed to help negate the effects of all the spelling variations that can occur for similar sounding names ( Smith, Smithe, Smythe, etc.). This way, users can index records based on a Soundex code based on the sound and “not” by how it is spelled.
The Soundex system is not infallible – the surnames Gough and Goff sound the same (Goff), but a different code is formed for these two names. Soundex can however be used to a great extent to get a desired result ( atleast closer to a desired result) This is a commonly used algorithm by many researchers.
In SQL a string function is available for this and is usually comes handy. The function is SOUNDEX().
It accepts a string (name ) as parameter and returns a 4 character code. This code is known as the soundex code of the name/string passed as parameter.
example:
Select Soundex(‘Smith’) O/P: S580
Select Soundex(‘Smithe’) O/P: S580
SELECT SOUNDEX(‘GREEN’) O/P: G652
Another use of this is against an user entered field where you need to look for a specific word, but the words might be mispelled( although it may not yield 100% result).