Databases > WideWorldImporters > Tables > Sales.CustomerTransactions

WideWorldImporters

Sales.CustomerTransactions

//
All financial transactions that are customer-related

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    CustomerTransactionID
    [int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[TransactionID])
  • //
    ${escapify(column.description)}
    CustomerID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    TransactionTypeID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    InvoiceID
    [int] NULL
  • //
    ${escapify(column.description)}
    PaymentMethodID
    [int] NULL
  • //
    ${escapify(column.description)}
    TransactionDate
    [date] NOT NULL
  • //
    ${escapify(column.description)}
    AmountExcludingTax
    [decimal](18, 2) NOT NULL
  • //
    ${escapify(column.description)}
    TaxAmount
    [decimal](18, 2) NOT NULL
  • //
    ${escapify(column.description)}
    TransactionAmount
    [decimal](18, 2) NOT NULL
  • //
    ${escapify(column.description)}
    OutstandingBalance
    [decimal](18, 2) NOT NULL
  • //
    ${escapify(column.description)}
    FinalizationDate
    [date] NULL
  • //
    ${escapify(column.description)}
    IsFinalized
    [bit] NULL
  • LastEditedBy
    [int] NOT NULL
  • LastEditedWhen
    [datetime2](8) NOT NULL DEFAULT (sysdatetime())

Indexes

  • CX_Sales_CustomerTransactions
    CLUSTERED
    TransactionDate
  • //
    Auto-created to support a foreign key
    FK_Sales_CustomerTransactions_CustomerID
    NONCLUSTERED
    CustomerID , TransactionDate
  • //
    Auto-created to support a foreign key
    FK_Sales_CustomerTransactions_TransactionTypeID
    NONCLUSTERED
    TransactionTypeID , TransactionDate
  • //
    Auto-created to support a foreign key
    FK_Sales_CustomerTransactions_InvoiceID
    NONCLUSTERED
    InvoiceID , TransactionDate
  • //
    Auto-created to support a foreign key
    FK_Sales_CustomerTransactions_PaymentMethodID
    NONCLUSTERED
    PaymentMethodID , TransactionDate
  • //
    Allows quick location of unfinalized transactions
    IX_Sales_CustomerTransactions_IsFinalized
    NONCLUSTERED
    IsFinalized , TransactionDate
  • PK_Sales_CustomerTransactions
    UNIQUE NONCLUSTERED
    CustomerTransactionID

Foreign Keys

  • FK_Sales_CustomerTransactions_Application_People
    Application.People
    LastEditedBy ⥱ PersonID
  • FK_Sales_CustomerTransactions_CustomerID_Sales_Customers
    Sales.Customers
    CustomerID ⥱ CustomerID
  • FK_Sales_CustomerTransactions_InvoiceID_Sales_Invoices
    Sales.Invoices
    InvoiceID ⥱ InvoiceID
  • FK_Sales_CustomerTransactions_PaymentMethodID_Application_PaymentMethods
    Application.PaymentMethods
    PaymentMethodID ⥱ PaymentMethodID
  • FK_Sales_CustomerTransactions_TransactionTypeID_Application_TransactionTypes
    Application.TransactionTypes
    TransactionTypeID ⥱ TransactionTypeID

Sample Data

CustomerTransactionID
CustomerID
TransactionTypeID
InvoiceID
PaymentMethodID
TransactionDate
AmountExcludingTax
TaxAmount
TransactionAmount
OutstandingBalance
FinalizationDate
IsFinalized
LastEditedBy
LastEditedWhen
2
832
1
1
NULL
2300
345
2645
NULL
true
10
5
803
1
2
NULL
405
60.75
465.75
NULL
true
10
7
1
1
3
NULL
90
13.5
103.5
NULL
true
10
11
1
1
4
NULL
445.2
66.78
511.98
NULL
true
10
15
905
1
5
NULL
704
105.6
809.6
NULL
true
10
19
976
1
6
NULL
430
64.5
494.5
NULL
true
10
24
401
1
7
NULL
603.5
90.53
694.03
NULL
true
10
28
964
1
8
NULL
258
38.7
296.7
NULL
true
10
31
1
1
9
NULL
178
26.7
204.7
NULL
true
10
34
1
1
10
NULL
104
15.6
119.6
NULL
true
10
36
401
1
11
NULL
13
1.95
14.95
NULL
true
10
39
401
1
12
NULL
229
34.35
263.35
NULL
true
10
42
401
1
13
NULL
2430
364.5
2794.5
NULL
true
10
46
870
1
14
NULL
650
97.5
747.5
NULL
true
10
49
991
1
15
NULL
174
26.1
200.1
NULL
true
10
51
401
1
16
NULL
68
10.2
78.2
NULL
true
10
54
910
1
17
NULL
424
63.6
487.6
NULL
true
10
56
949
1
18
NULL
91
13.65
104.65
NULL
true
10
60
973
1
19
NULL
3185
477.75
3662.75
NULL
true
10
62
884
1
20
NULL
240
36
276
NULL
true
10
66
1
1
21
NULL
535
80.25
615.25
NULL
true
10
69
890
1
22
NULL
3182
477.3
3659.3
NULL
true
10
73
1
1
23
NULL
1490
223.5
1713.5
NULL
true
10
76
873
1
24
NULL
472
70.8
542.8
NULL
true
10
79
401
1
25
NULL
129
19.35
148.35
NULL
true
10