I have a case where we have a company preference table where preferences are set and can be overridden by users. Preferences can be added to the table and the users should inherit them and can override them if they wish to do so by adding a record in the user 'UserBeer' table.
Beer (Table)
BeerId,
BeerName,
Rating
UserBeer (Table)
UserId,
BeerId,
Rating
I'm reading through the Inheritance mapping section of the docs and am trying to figure out if this is something that would produce a result similar to the following...
Select
b.BeerId,
b.BeerName,
IsNull(ub.Rating, b.Rating) As Rating
From Beer b
Left Join UserBeer ub On b.BeerId = ub.BeerId
If there isn't a UserBeer record for a particular user and beer then the Rating will be null. In this case use the value from the Beer table for that particular beer.
I wish there was really a beer table