问题
We're trying to come up with the data model of Payment Method. There can be several kinds of payment methods like Card, Bank Transfer, Wallet, which further can be categorized for e.g. Card into credit/debit cards, Bank Transfer into ACH/SEPA and the like.
So this is about modelling inheritance into database tables. One option is to use single table inheritance. Senior folks in my team call single table as denormalized table. But I don't understand why? I don't see any insert/delete/update anomalies here, each payment method record is independent in its own, there are no redundancies. It's just there will be lots of nulls in the table as set of columns will be union of all payment methods.
回答1:
You are probably right. Typically a supertype table with nulls is the left join of a common-attribute table & some subtype tables. (A union of joins.) But normalization losslessly decomposes to projections & denormalization undoes that via natural join. So here the rearrangement to smaller tables is probably not normalization & is not done for the reasons we normalize & recombining is probably not denormalization. So "denormalized" & "normalized" are misused. Still--even if they use the wrong word there can still be a problem. Why don't you ask them what they mean?
来源:https://stackoverflow.com/questions/53369171/does-single-table-inheritance-results-in-denormalization