|
So, I'm a little late to the DDL party. Since I work on JD Edwards, I seldom have the need to create a new file. But, working on one now.
I'm not wanting to start a religious argument here, but I'm afraid this is going to...
So I've read up on DDL and came across some recommendations for best practices for database design. These two points specifically are what I'm questioning:
. Every table should have a primary key. The Primary Key should be an identity column, NOT business data
. Create business key as unique from business data, not Primary Key
I'm creating a simple Customer address file: Last Name, First Name, Address, City, State, Zip. So I've created an auto-incrementing identity field as id.
In my mind, the id should also be unique, but the recommendation is to only use business data. What's the point of having a Primary Key separate from a Unique key? In the past, I would've created a 'Customer#' field and incremented that field in the RPG. The Customer# field would be both unique and primary.
So to follow these best-practices, do I create the Customer# row in addition to id as identity and mark Customer# as Unique?
If so, then can I set Customer# to auto-increment without marking it as identity, or do I still handle the incrementing in the program?
Or do I forgo the Customer# row entirely and define the Unique Key from the rest of the fields? I would basically have to include every field in order to make it unique.
I'm open to suggestions/discussion?
Thanks
Bob Cagle
IT Manager
Lynk
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.