Principle and Principal sound similar but spell differently i.e., they have identical phonetics but not the spelling. The same is the case with ball and boll and many other words. To compare database entries based on phonetics instead of spellings on the DB server running MySQL there is an inbuilt function available.

Soundex is an interesting and admiring function that will compare string pronunciations but not the actual strings. The function indeed uses Soundex algorithm

This may also be an algorithm used for spelling suggestions in some places.

For example, Google shows the proper word in ‘Did you mean’



In English, the word ball and boll both are pronounced similarly although their spellings are different. if we use = operator in MySQL as below it will give 0 (zero) as they are not same.
select 'ball'='boll' from dual
But, if we use the function Soundex as below it will give 1 as both are pronounced similar.
select soundex('ball')=soundex('boll') from dual
On the other hand sometimes when we have to do a select with where check then we can use sounds like. Sample select with where statement is
select * from toys where toy_name sounds like 'boll'
Sample statement result is(assume toys table has some records)
IdToyname
1boll
2ball
3bol
4bool
5baal

Try urself with some words listed below
  • principle,principal,princpl
  • text,test
  • next,nest
  • tool,tuul
  • tie,tih