I create a list of participants on my site, and I want them to be able to search each other by name and surname or one at a time. The trick is that the user can have several names, such as first names and then nicknames, also the person can have more than one last name, his maiden name, and then the last name after marriage.
When users fill in their first and last names, each user can have several names and last names, for example, there can be a person with three names and two last names: Eleanor, Al, El and last name: Smith, Brown.
Then if someone is looking for Ela Brown, Eleanor Brown, Eleanor Smith or any other combination, they must find this person.
My question is: how should I install all this in sql (mysql) so that the schema and search are efficient and fast? I didn’t want to reinvent the wheel, so I turned to the professionals and asked a question here.
Thanks guys,
PS I assume that the standard solution would be to have a user table, a fname table, a lname table, a userfname table with userid and lnameid identifiers, and userlname with userid and lnameid ids, but I'm not sure if this is the best way to do this and or not the search will be quick ...
source share