Click to See Complete Forum and Search --> : 3 tables, common schema


Myndale
June 23rd, 2010, 08:33 PM
I need to create 3 database tables: Male Names, Female Name and Surnames. Each of these tables will have exactly the same fields: Name, Frequency, and Rank. What's the best way to implement this in C# / .NET?

1) Create 3 tables within the same database and give each the same fields. Probably the easiest to do initially but it would result in 3 separate schema.

2) Create a single table and save the data in 3 separate database files. Connection strings are easy enough to change at runtime, but this seems a bit extreme.

3) Put all data into a single table and add a field to specify what type of name it is. This will slow down searches and it also means I can't use rank as the primary key, should I want to.

4) A better method that I don't know about yet.

Cheers!

dannystommen
June 25th, 2010, 02:25 AM
I would go for option 3. Create a single table, use the rank and type of name as primay key. And if you create the correct indexes, it won't slow down searches..

TechGnome
June 28th, 2010, 12:20 PM
What is "Rank"? I'm not sure that's a good candidate for being a PKey... I'd be more inclined to use Name and NameType as the PKey...

-tg