You are a database developer on an instance of SQL Server 2008. Your Product table is defined as follows:
Correct Answer: A
Explanation/Reference:
The Table-per-Hierarchy inheritance model allows you to create an EDM that supports inheritance within a single database table. In this scenario, you have a Product table that contains a ProductType column. The ProductType column, known as the discriminator column, identifies whether the product is a physical product or a virtual product. Certain columns in the Product table are applicable to physical products but not to virtual products. For example, a physical product will have a value for the UnitsInStock, LocationID, and ReorderPoint columns, and a virtual product will not.
To implement such a model in this scenario, you would create a base entity to represent a Product. Then you would create additional entities, for example PhysicalProduct and VirtualProduct, which inherit from the base entity. The PhysicalProduct entity would contain the properties applicable to products in physical inventory, and the VirtualProduct entity would contain the properties applicable to virtual products. You should note that because the UnitsInStock, LocationID, and ReorderPoint columns would not be applicable to virtual products and the ActivationDate and RenewalDate columns would not be applicable to physical products, all of these columns must be defined to allow null values.
You should not create a data model that implements Table-per-Type inheritance. The Table-per-Type inheritance model allows you to create an EDM that supports inheritance with multiple tables. You would use this inheritance model if you had a Product table that contained columns relating to all products and other tables that contained columns relating to specific product types. For example, you might have a Product table that has a one-to-one relationship with both the PhysicalProduct and VirtualProduct tables, as shown in the following diagram:
The Product table would hold the columns related to all products, and the PhysicalProduct and VirtualProduct tables would contain columns of their respective product types. Each of these tables would have to be represented by a separate entity in the data model. The Product entity would be the base entity, and the PhysicalProduct and VirtualProduct entities would inherit from it.
You should not create a data model that includes a complex type. You would create a data model with a complex type if you wanted an entity property in the data model to also have properties.
You should not create a data model that implements a single entity with multiple associations. To implement single-table inheritance in this scenario, you must create a base entity and entities that inherit from the base entity. A single entity would not suffice. Associations are used to create logical relationships between entities in an EDM.