Owner: | dbo |
Creation Date: | 08/06/2000 |
Located On: | PRIMARY |
Data Size KB: | 72 |
Index Size KB: | 208 |
Rows: | 2155 |
Description: |
Name | Data Type | Length | NULL | Default | IsIdentity | IsGUID | Description | ||
|
|
OrderID | int | 4 |
|
|
|
||
|
|
ProductID | int | 4 |
|
|
|
||
|
UnitPrice | money | 8 |
|
(0) |
|
|
||
|
Quantity | smallint | 2 |
|
(1) |
|
|
||
|
Discount | real | 4 |
|
(0) |
|
|
Index | Primary | Unique | Description | |
|
PK_Order_Details |
|
|
|
|
OrderID |
|
|
|
|
OrdersOrder_Details |
|
|
|
|
ProductID |
|
|
|
|
ProductsOrder_Details |
|
|
Name | Expression | |
|
CK_Discount | ([Discount] >= 0 and [Discount] <= 1) |
|
CK_Quantity | ([Quantity] > 0) |
|
CK_UnitPrice | ([UnitPrice] >= 0) |
Table | Foreign Key | Primary Key or Unique Constraint | |
|
dbo.Orders | FK_Order_Details_Orders | PK_Orders |
|
dbo.Products | FK_Order_Details_Products | PK_Products |
Objects that [dbo].[Order Details] depends on
Object Name | Owner | Object Type | Dep Level | |
|
Categories | dbo | Table | 1 |
|
Customers | dbo | Table | 1 |
|
Employees | dbo | Table | 1 |
|
Shippers | dbo | Table | 1 |
|
Suppliers | dbo | Table | 1 |
|
Orders | dbo | Table | 2 |
|
Products | dbo | Table | 2 |
Objects that depend on [dbo].[Order Details]
Object Name | Owner | Object Type | Dep Level | |
|
Invoices | dbo | View | 1 |
|
Order Details Extended | dbo | View | 1 |
|
Order Subtotals | dbo | View | 1 |
|
Product Sales for 1997 | dbo | View | 1 |
|
CustOrderHist | dbo | Procedure | 1 |
|
CustOrdersDetail | dbo | Procedure | 1 |
|
SalesByCategory | dbo | Procedure | 1 |
|
Category Sales for 1997 | dbo | View | 2 |
|
Sales by Category | dbo | View | 2 |
|
Sales Totals by Amount | dbo | View | 2 |
|
Summary of Sales by Quarter | dbo | View | 2 |
|
Summary of Sales by Year | dbo | View | 2 |
|
Employee Sales by Country | dbo | Procedure | 2 |
|
Sales by Year | dbo | Procedure | 2 |
CREATE TABLE [Order Details] (
[OrderID] [int] NOT NULL ,
[ProductID] [int] NOT NULL ,
[UnitPrice] [money] NOT NULL CONSTRAINT [DF_Order_Details_UnitPrice] DEFAULT (0),
[Quantity] [smallint] NOT NULL CONSTRAINT [DF_Order_Details_Quantity] DEFAULT (1),
[Discount] [real] NOT NULL CONSTRAINT [DF_Order_Details_Discount] DEFAULT (0),
CONSTRAINT [PK_Order_Details] PRIMARY KEY CLUSTERED
(
[OrderID],
[ProductID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Order_Details_Orders] FOREIGN KEY
(
[OrderID]
) REFERENCES [Orders] (
[OrderID]
),
CONSTRAINT [FK_Order_Details_Products] FOREIGN KEY
(
[ProductID]
) REFERENCES [Products] (
[ProductID]
),
CONSTRAINT [CK_Discount] CHECK ([Discount] >= 0 and [Discount] <= 1),
CONSTRAINT [CK_Quantity] CHECK ([Quantity] > 0),
CONSTRAINT [CK_UnitPrice] CHECK ([UnitPrice] >= 0)
) ON [PRIMARY]
GO
See Also
List of tables