数据库的变化
页: 1
2 - 增加新的表格iC_ProductDimensions,以掌握产品的不同层面数据。 下文详细介绍了在iC_ProductDimensions中使用的不同栏目。
1- DimensionId - This is the primary key in the table and of bigint datatype.
2- UOMID - (FK) Unit of Measurement ID , this is refrenced from the table iC_ProductUnitOfMeasure.
3- ProductFeatureId : This is referenced column from the iC_ProductFeature table.
4- NumericValue : This column stores the dimensional value (e.g. if UOM is pound and this column stores 10 than we can say that Weight of product is 10 pound.
在iC_ProductUnitOfMeasure中添加了3-1栏测量Type。
4- 从瓦尔果(100)改为大豆的产品名称数据类型
数据流动
计量 IC_ProductUnitOfMeasure的类型将储存用于哪一个电动单位的测量。
e.g. let s take a snapshot view of rows in iC_ProductUnitOfMeasure
UOMID Abbrivation MeasurementType Description
1 lb Weight This UOM is used for measuring weight of the product
2 inch. Width This UOM is used for measuring width of the product
3 meter Length This UOM is used for measuring length of the product
4 Kg Weight This UOM is used for measuring weight of product in Kg.
在上述例子中,我们把每个南太平洋大学同其联系测量Type挂钩。
UOM 1可用于测量四氧化硫中产品重量。
添加产品年限为0.5米的产品,产品宽度为50英寸,产品重量为100磅。
1 - 在iC_Product table上创记录,储存产品的共同特性。 (支持产品Id = ICPR0001)
2- 在iC_ProductFeature中创下记录,并储存彩色、体积、重量、 h/w等共同产品特征。 (产品名称一)
3- 如下文所示,在iC_ProductDimesion表上设立3个记录。
DimensionID UOMID ProductFeatureId NumericValue
1 1 1 100
2 2 1 50
3 3 1 0.5
4- 在IC_ProductFeatureApplicability with (ProductId = ICPR0001 and ProductsFeature)中添加一个记录 Id = 1
获取产品不同层面价值的数据ICPR001
select
product .* ,
productFeature.* ,
( CAST (dimension.NumericValue as Varchar(100) )+" " + UOM.Abbrivation) as Dimension ,
dimension.MeasurementType
from
iC_Product product ,
iC_ProductFeature productFeature ,
iC_ProductFeatureApplicability ,
iC_ProductDimesions dimension ,
iC_ProductUnitOfMeasure UOM
where
iC_ProductFeatureApplicability.ProductId = product.ProductId
and
iC_ProductFeatureApplicability.ProductFeatureId = productFeature.ProductFeatureId
and
dimension.ProductFeatureId = productFeature.ProductFeatureId
and
dimension.UOMID= UOM.UOMID
and
product.ProductId = ICPR001