Table: Bank_Account
Columns
Name | Type | Constraints | Description
bank_account_KEY | int | NOT NULL | AUTO-INCREMENT: Database assigned primary key for this table
update__staff_KEY | int | NOT NULL |
update_date | datetime | NOT NULL |
bank_account_id | nvarchar (11) | NOT NULL | User defined identifier (unique)
description | nvarchar (30) | NOT NULL | User defined description.
create_date | datetime | NOT NULL |
bank_account_id_sortable | varchar (48) | NOT NULL | A representation of the bank_account_id column that sorts in natural order, meaning that digits are sorted as numbers while non-digits are sorted alphabetically. A trigger keeps this field synchronized with the content of bank_account_id.

Primary key
Name | Columns | Description
PK_Bank_Account$bank_account_KEY | bank_account_KEY | CLUSTERED
Unique constraints
Name | Columns | Description
UK_Bank_Account__bank_account_id | bank_account_id | Each id must be unique.
UK_Bank_Account__bank_account_id_sortable | bank_account_id_sortable | An index by the sortable ID is desired, and the algorithm ends up producing unique values.

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Ledger_Entry__Bank_Account__bank_account_KEY | bank_account_KEY | Ledger_Entry |
FK_User_Preference__Bank_Account__receipt_entry__bank_account_KEY | receipt_entry__bank_account_KEY | User_Preference |
FK_User_Preference__Bank_Account__receipt_entry_adjustment__bank_account_KEY | receipt_entry_adjustment__bank_account_KEY | User_Preference |