Databases > AdventureWorks2019 > Tables > Purchasing.PurchaseOrderDetail

AdventureWorks2019

Purchasing.PurchaseOrderDetail

//
Individual products associated with a specific purchase order. See PurchaseOrderHeader.

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    PurchaseOrderID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    PurchaseOrderDetailID
    [int] IDENTITY (1,1) NOT NULL
  • //
    ${escapify(column.description)}
    DueDate
    [datetime] NOT NULL
  • //
    ${escapify(column.description)}
    OrderQty
    [smallint] NOT NULL
    //
    CONSTRAINT: Check constraint [OrderQty] > (0)
    ([OrderQty]>(0))
  • //
    ${escapify(column.description)}
    ProductID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    UnitPrice
    [money] NOT NULL
    //
    CONSTRAINT: Check constraint [UnitPrice] >= (0.00)
    ([UnitPrice]>=(0.00))
  • //
    ${escapify(column.description)}
    LineTotal
    [money] NOT NULL
  • //
    ${escapify(column.description)}
    ReceivedQty
    [decimal](8, 2) NOT NULL
    //
    CONSTRAINT: Check constraint [ReceivedQty] >= (0.00)
    ([ReceivedQty]>=(0.00))
  • //
    ${escapify(column.description)}
    RejectedQty
    [decimal](8, 2) NOT NULL
    //
    CONSTRAINT: Check constraint [RejectedQty] >= (0.00)
    ([RejectedQty]>=(0.00))
  • //
    ${escapify(column.description)}
    StockedQty
    [decimal](9, 2) NOT NULL
  • //
    ${escapify(column.description)}
    ModifiedDate
    [datetime] NOT NULL DEFAULT (getdate())

Indexes

  • //
    Clustered index created by a primary key constraint.
    PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID
    UNIQUE CLUSTERED
    PurchaseOrderID , PurchaseOrderDetailID
  • //
    Nonclustered index.
    IX_PurchaseOrderDetail_ProductID
    NONCLUSTERED
    ProductID

Foreign Keys

  • //
    Foreign key constraint referencing Product.ProductID.
    FK_PurchaseOrderDetail_Product_ProductID
    Production.Product
    ProductID ⥱ ProductID
  • //
    Foreign key constraint referencing PurchaseOrderHeader.PurchaseOrderID.
    FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID
    Purchasing.PurchaseOrderHeader
    PurchaseOrderID ⥱ PurchaseOrderID

Sample Data

PurchaseOrderID
PurchaseOrderDetailID
DueDate
OrderQty
ProductID
UnitPrice
LineTotal
ReceivedQty
RejectedQty
StockedQty
ModifiedDate
1
1
4
1
50.26
201.04
3
NULL
3
2
2
3
359
45.12
135.36
3
NULL
3
2
3
3
360
45.5805
136.7415
3
NULL
3
3
4
550
530
16.086
8847.3
550
NULL
550
4
5
3
4
57.0255
171.0765
2
1
1
5
6
550
512
37.086
20397.3
550
NULL
550
6
7
550
513
26.5965
14628.075
468
NULL
468
7
8
550
317
27.0585
14882.175
550
NULL
550
7
9
550
318
33.579
18468.45
550
NULL
550
7
10
550
319
46.0635
25334.925
550
NULL
550
8
11
3
403
47.4705
142.4115
3
NULL
3
8
12
3
404
45.3705
136.1115
3
NULL
3
8
13
3
405
49.644
148.932
3
NULL
3
8
14
3
406
45.3705
136.1115
3
NULL
3
8
15
3
407
43.2705
129.8115
3
NULL
3
9
16
3
422
47.523
142.569
3
NULL
3
9
17
3
423
45.423
136.269
3
NULL
3
9
18
3
424
49.6965
149.0895
3
NULL
3
9
19
3
425
45.423
136.269
3
NULL
3
9
20
3
426
43.323
129.969
3
NULL
3
10
21
3
320
47.4705
142.4115
3
NULL
3
10
22
3
321
42.798
128.394
3
NULL
3
10
23
60
322
25.4205
1525.23
60
NULL
60
11
24
3
438
41.223
123.669
3
NULL
3
11
25
3
439
45.4965
136.4895
3
NULL
3