Databases > WideWorldImporters > Tables > Sales.OrderLines

WideWorldImporters

Sales.OrderLines

//
Detail lines from customer orders

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    OrderLineID
    [int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[OrderLineID])
  • //
    ${escapify(column.description)}
    OrderID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    StockItemID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    Description
    [nvarchar](100) NOT NULL
  • //
    ${escapify(column.description)}
    PackageTypeID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    Quantity
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    UnitPrice
    [decimal](18, 2) NULL
  • //
    ${escapify(column.description)}
    TaxRate
    [decimal](18, 3) NOT NULL
  • //
    ${escapify(column.description)}
    PickedQuantity
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    PickingCompletedWhen
    [datetime2](8) NULL
  • LastEditedBy
    [int] NOT NULL
  • LastEditedWhen
    [datetime2](8) NOT NULL DEFAULT (sysdatetime())

Indexes

  • PK_Sales_OrderLines
    UNIQUE CLUSTERED
    OrderLineID
  • //
    Auto-created to support a foreign key
    FK_Sales_OrderLines_OrderID
    NONCLUSTERED
    OrderID
  • //
    Auto-created to support a foreign key
    FK_Sales_OrderLines_PackageTypeID
    NONCLUSTERED
    PackageTypeID
  • //
    Allows quick summation of stock item quantites already allocated to uninvoiced orders
    IX_Sales_OrderLines_AllocatedStockItems
    NONCLUSTERED
    StockItemID , PickedQuantity
  • //
    Improves performance of order picking and invoicing
    IX_Sales_OrderLines_Perf_20160301_01
    NONCLUSTERED
    PickingCompletedWhen , OrderID , OrderLineID , Quantity , StockItemID
  • //
    Improves performance of order picking and invoicing
    IX_Sales_OrderLines_Perf_20160301_02
    NONCLUSTERED
    StockItemID , PickingCompletedWhen , OrderID , PickedQuantity
  • NCCX_Sales_OrderLines
    NONCLUSTERED COLUMNSTORE
    OrderID , StockItemID , Description , Quantity , UnitPrice , PickedQuantity

Foreign Keys

  • FK_Sales_OrderLines_Application_People
    Application.People
    LastEditedBy ⥱ PersonID
  • FK_Sales_OrderLines_OrderID_Sales_Orders
    Sales.Orders
    OrderID ⥱ OrderID
  • FK_Sales_OrderLines_PackageTypeID_Warehouse_PackageTypes
    Warehouse.PackageTypes
    PackageTypeID ⥱ PackageTypeID
  • FK_Sales_OrderLines_StockItemID_Warehouse_StockItems
    Warehouse.StockItems
    StockItemID ⥱ StockItemID

Sample Data

OrderLineID
OrderID
StockItemID
Description
PackageTypeID
Quantity
UnitPrice
TaxRate
PickedQuantity
PickingCompletedWhen
LastEditedBy
LastEditedWhen
1
45
164
32 mm Double sided bubble wrap 50m
7
50
112
15
50
4
2
1
67
Ride on toy sedan car (Black) 1/12 scale
7
10
230
15
10
3
3
2
50
Developer joke mug - old C developers never die (White)
7
9
13
15
9
3
4
46
89
"The Gu" red shirt XML tag t-shirt (Black) 3XS
7
72
18
15
72
4
5
46
171
32 mm Anti static bubble wrap (Blue) 10m
7
90
32
15
90
4
6
2
10
USB food flash drive - chocolate bar
7
9
32
15
9
3
7
47
167
10 mm Anti static bubble wrap (Blue) 50m
7
50
99
15
50
4
8
47
219
Void fill 400 L bag (White) 400L
7
80
50
15
80
4
9
3
114
Superhero action jacket (Blue) XXL
7
3
30
15
3
3
10
47
72
Ride on toy sedan car (Pink) 1/12 scale
7
9
230
15
9
4
11
4
206
Permanent marker black 5mm nib (Black) 5mm
7
96
2.7
15
96
3
12
4
130
Furry gorilla with big eyes slippers (Black) S
7
5
32
15
5
3
13
4
50
Developer joke mug - old C developers never die (White)
7
2
13
15
2
3
14
5
128
Plush shark slippers (Gray) L
7
4
32
15
4
3
15
48
100
"The Gu" red shirt XML tag t-shirt (Black) 6XL
7
72
18
15
72
4
16
48
151
Pack of 12 action figures (male)
9
8
16
15
8
4
17
5
121
Dinosaur battery-powered slippers (Green) XL
7
3
32
15
3
3
18
5
155
Large sized bubblewrap roll 50m
7
20
24
15
20
3
19
6
150
Pack of 12 action figures (variety)
9
4
16
15
4
3
20
6
40
Developer joke mug - (hip, hip, array) (White)
7
6
13
15
6
3
21
6
126
Plush shark slippers (Gray) S
7
9
32
15
9
3
22
7
39
Developer joke mug - inheritance is the OO way to become wealthy (Black)
7
9
13
15
9
3
23
7
184
Shipping carton (Brown) 305x305x305mm
7
75
3.5
15
75
3
24
7
9
USB food flash drive - banana
7
6
32
15
6
3
25
49
156
10 mm Double sided bubble wrap 10m
7
100
15
15
100
4