how to generate unique keys for the same customer?
Moderators: chulett, rschirm, roy
how to generate unique keys for the same customer?
In Banking Domain,a new customer deposits some amount say Rs.5000.The same day the customer withdraws Rs.1000.Will the customer be generated with 2 different surrogate keys generating duplicate records if the target table is used as Reference table while performing a lookup?
The Answer depends. Are you storing the deposit and withdrawal information in the same table? If yes, there should another column that should be part of the key on that table that defines if the transaction(record) is a deposit or withdrawal. You should not be creating different Surrogate Keys for the same customer.
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
No. The record will/should be treated as an update record. Again that depends on the data model you have.natashab wrote:Then will not the same customer having 2 incoming records with the amount deposited and amount withdrawn details be looked up and considered as 2 new records?
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Are you populating the transaction or customer master ?
If it is transaction, you will have 2 entries - one for each transaction.
For customer master, you can try including a 'remove duplicates' to obtain distinct list. Also reference to existing customer master will ensure retaining keys for old ones.
If it is transaction, you will have 2 entries - one for each transaction.
For customer master, you can try including a 'remove duplicates' to obtain distinct list. Also reference to existing customer master will ensure retaining keys for old ones.
-
- Participant
- Posts: 63
- Joined: Mon Oct 20, 2008 12:01 am
- Location: Malaysia