D
D
Denis2015-02-12 17:32:28
Database design
Denis, 2015-02-12 17:32:28

What is better, one large table or many identical and small ones?

There is a table "Land_plots" with columns

{ID, Permitted_UseId, Land_CategoryId, Presence_of_PlumbingId}

As well as auxiliary tables - reference books ("Permitted_uses", "Categories_of_land", "Availability_of_water supply"), which have the same structure
{id, text}
And they themselves are just a list of options to fill out.
Relationships : One row from the "Permitted Use" table (either from "Category_of_land" or "Availability_of_Plumbing") has
relationships to many rows from the "Lands" table . ("Directory" and "TypeText") with structure:
"Directory" table
{ID, Text, TypeId}

table "TypeText"
{id,text}
(Text = {"Permitted use", "Land_category","Plumbing_availability"})
Relationships: One row from the "TypeText" table has a relationship with several rows in the "Directory" table.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2015-02-12
@evolit

The correct option would be "many small tables".
It will allow you to link these small tables with the main one using foreign keys, which will ensure consistency.
In the case of a dump, a "great dictionary", the programmer will have to make sure that the categories are not confused.

D
Denis, 2015-02-18
@evolit

Sergey
As a result found two methods to use your variant (through Enum).
1) Via attribute

[Description("bla bla")]
Reading attribute: https://dotnetfiddle.net/2qmx9w thanks Sergey
DropDownList for MVC (via extension method): stackoverflow.com/a/16089319
2) Via attribute
[Display(Name = "Blabla")]"
Reading the attribute: https://dotnetfiddle.net/M9G4bT (essentially the same)
DropDownList for MVC 5 (native helper): stackoverflow.com/a/22295360
I personally really like the method itself. Conveniently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question