正在加载图片...
Domain Constraints Domain constraints are the most elementary form of integrity constraint.They test values inserted in the database,and test queries to ensure that the comparisons make sense. New domains can be created from existing data types Example:create domain Dollars numeric(12,2) create domain Pounds numeric(12,2) We cannot assign or compare a value of type Dollars to a value of type Pounds. However,we can convert type as below (cast r.A as Pounds) (Should also multiply by the dollar-to-pound conversion-rate) Database System Concepts,5th Edition,Oct 5.2006 4.6 Silberschatz,Korth and SudarshanDatabase System Concepts, 5th Edition, Oct 5. 2006 4.6 ©Silberschatz, Korth and Sudarshan Domain Constraints Domain constraints are the most elementary form of integrity constraint. They test values inserted in the database, and test queries to ensure that the comparisons make sense. New domains can be created from existing data types Example: create domain Dollars numeric(12, 2) create domain Pounds numeric(12,2) We cannot assign or compare a value of type Dollars to a value of type Pounds. However, we can convert type as below (cast r.A as Pounds) (Should also multiply by the dollar-to-pound conversion-rate)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有