Database design: multiple "options" tables vs. a single table -


I believe that all of us have seen this design requirement in one or another form.

The software needs to be offered for a variety of different queries / settings. Many such questions can easily cross 50 in a big project.

Now.

Do you have to fix 50+ tables with similar designs? ] [setting 1] ([ID] is not unique identifier, [name] varchar (max) no) create faucet [dbo]. [Settings 2] ([ID] is not a unique identifier, [name] varchar (max) tap)

etc.

And then these tables are linked through foreign keys like this:

  [tab] [user's settings] ([user id] not unique identifier null , [Setting 1aid] is not a unique identifier, [setting 2 id] is not unique identifier) ​​or is it more sensible to create a "master" option table?  
  create table [dbo]. [Settings] ([ID] is not a unique identifier, [name] varchar (max) faucet [SettingCode] INT not zero)  

In addition to multiplying tables with similar structure in F What are the advantages and disadvantages of Irst matters and there is no lack of integrity in the other?

I had to go with the last option in the lookup table, but a slightly different naming scheme ...

"Settings", where you store different names / descriptions of settings, with the primary key for each. Then, divide users into settings in another table. Unlimited settings, unlimited user / setting relationship

Settings

Settings ID - Primary Key
SettingName


User Settings

UserID
setting ID


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -