sql server 2008 - Polymorphic database design : does this approach have a name? -


I have a base antish (item) that has a huge type of item type (& gt; 200) with different properties. ) Will host. I want a clean, portable and fast solution and came up with an idea that Mbeya has a name which I am unaware of.

It goes here:

  • The item-unit places additional fields for the Base Class + sub-category field, but the dummy-name, the item IDID , Item number, mothertipid, int1, int2, dc1, dc 2, dc3, sr1, sr2

  • referenced item type-type in type and hair enity ( 1: n) is the name of:

  • Motherless field [[itemtypeid, name, type, realfield] in the example [53, MaxPressure, < P>

    The limitations are:

    • Change the field requirements in the base class Difficult to calculate
    • Adding a domain is difficult
    • In real-time
    • Only possible types of queries can be defined at one time for the same type of query Is "real-field" <3> Bullet explained:
        Select items, _MaxPressure_ from those items where ItemTypeID = 10 and _MaxPressure_ & gt; 42 should translate into the following: Select MaxPressure from items such as item no, DC3, where item type = 10 and DC3 & gt; 42   

      (Can not do this with the authority of SP or UDF - or will it be possible?)

      But its benefits:

      • Display
      • Ease of operation of CRUD
      • Easy to sort / filter at the application level

        Now - is its name?

        This antipatan is called

        In a relational database, each column Must be defined as a logical type. I do not mean that a SQL data type such as INT or VAAR, I mean that the columns should be from the same set of values ​​from start to finish, and you should be able to tell a value with the second value .

        You can not put shoe size and average temperature and threads per inch in the same column of a given table, and still it is called a relation.

        Actually, your database will not be enough to be a database - this will be an spreadsheet .

        Read almost any book from the date of CJ, for proper explanation of relationships and types.


        Redo your comment:

        Read the questions before joking about lecturing and semi-structured data about primary books.

        OK, I've read your post again

        The classic use of a true lookup table Absolutely what you're doing, but You are sharing the same problems with OTLT.

        Suppose you have the "MaxPressure" column stored for ItemType 10 in dec3 . Let's say that there is a certain set of valid options for Maxbureauer's value, and you want to put it in another lookup table, so that no invalid MaxPressure value can be entered.

        Now: Announce a foreign key obligation on dec3 referencing your MaxPressures lookup table. You - The problem is not that foreign key compulsions apply to the DC3 column in all rows, not in the rows where the item type is type 10.

        The reason for this is that you are collecting more than one set of values ​​in a single column. The same problem arises for any other kind of obstacles - unique obstacles, check obstacles and not even taps. And you can not declare any default value for the column, because there is probably a different correct default for each of your item types (and some item types have no default for this attribute).

        The reason that I have a CJ date book is that it gives a crisp definition for type : it is a nominated finite set, on which the equality operation is defined. That is, you can tell that the value "42" on one line is similar to the value "42" in a relational column, it should be true because they should come from the original set as values. In your table, dec3 can have a value of "42" when it is MaxPay, but "42" for another item type when it is thread per inch, so they Similar values ​​are not "42" If you have a unique barrier, then both of these 42 will not be considered duplicates. If you have a foreign key, then each of the different 42 will reference each separate lookup table, etc.

        What you are doing is not a valid relational database design.

        Do not force you to refer to a resource on a relational database design, unless you understand it.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -