954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Using a field for Alternative names

Hello,

I am designing a database for my school library.

10% of the books in the database are French, and thus have words with accents like Château.

My issue is that I'd like the user to search for book by typing Chateau (as it is too difficult to type in words with accents), however, when a list of results come back, it would appear as Château

My initial solution was to build a field for alternative names to do the search under

For example

TitleID: 1001
Title: Château
Alt_Title: Chateau

However, since only 10% of the books have accents, there would be 90% redundancy, as all the other books would look like this.

TitleID 1002
Title: Catcher in the Rye
Alt_Title: Catcher in the Rye

Is there a simpler solution?

Joel

Baxtula
Newbie Poster
6 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

Use the LIKE function when a user searches.

SELECT FROM MyBooks WHERE Title LIKE %Chateau%
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Brilliant! Thanks!

Baxtula
Newbie Poster
6 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

Only a pleasure.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Let me add an idea. If you are going to use "LIKE" then you need to decide what things are wild cards (all vowels?). There may be a better way:

A really helpful search technique would look for homophone matches as well as more accurate spellings . Soundex is an English-based system which might be helpful. I might suggest a secondary table containing columns `sounds_like` and a primary key into the main table. Multiple word titles, of course would have multiple rows in that table; and the lookup could not be done (easily) entirely in SQL.

griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
 

Great idea! I'll try that out Griswolf!

Baxtula
Newbie Poster
6 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You