Column_name | 數(shù)據(jù)類型 | 可以為空 | 默認(rèn)值 | 檢查 | 鍵/索引 |
---|---|---|---|---|---|
OrderID | int | 否 | 組合聚集主鍵1、外鍵 Orders(OrderID)2 | ||
ProductID | int | 否 | 組合聚集主鍵1、外鍵 Products(ProductID)3 | ||
UnitPrice | money | 否 | 0 | 是4 | |
Quantity | smallint | 否 | 1 | 是5 | |
Discount | real | 否 | 0 |
1 組合、主鍵、聚集索引在 OrderID 和ProductID 上定義。
2 在 OrderID 上也有兩個(gè)非聚集索引。
3 在 ProductID 上也有兩個(gè)非聚集索引。
4 UnitPrice 的 CHECK 約束被定義為 (UnitPrice >= 0)。
5 Quantity 的 CHECK 約束被定義為 (Quantity > 0)。
表級(jí)別的 CHECK 約束被定義為 (Discount >= 0 和 Discount < = 1)。