Results 1 to 7 of 7

Thread: DB design

  1. #1
    Join Date
    May 2013
    Posts
    6

    DB design

    Hi, I found 2 tables in my banking design system have the same primary key. Is it possible?
    Account Types Table: AccountType, Description
    Interest Rates Tables: AccountType, Interest Rate
    Both tables have the same primary key AccountType

    If not, which way is better:
    1. Join Interest Rate Table into Account Type Table
    Account Type Table: AccountType,Description, InterestRate
    2. Create new RateID in Interest Table:
    Account Types Table: AccountType, Description
    Interest Rates Tables: RateID, AccountType, Interest Rate

    Please help. Thkx

  2. #2
    Join Date
    Feb 2012
    Posts
    76
    Two tables with the same primary key are perfectly acceptable.

    Your first alternative can be equivalent, depending on whether Description and/or InterestRate are nullable, and the constraints on the original two tables.

    Your second alternative creates a surrogate for no good reason I can see.

  3. #3
    Join Date
    May 2013
    Posts
    6
    Thanks, I am thinking of option 2 with Rate Code now.
    For example,
    Same Loan Type Account, but it has different interest rate because of different promotions, Or Credit Card has different rate for Purchase/Cash Advance,
    Please let me know if I have any problem with this way.
    Thanks again

  4. #4
    Join Date
    Feb 2012
    Posts
    76
    It could work, if the values in the new field distinguish between different promotions or purchase/cash advance. Think about the different things you want to handle there - is it one domain or two? Would you want to have a rate for a purchase on promotion?

  5. #5
    Join Date
    May 2013
    Posts
    6
    Yes, my assignment requires interest rate vary depend on type of loans, credit, promotion, period of loan, etc I think I stay with option 2.
    Thank you very much.

  6. #6
    Join Date
    Feb 2012
    Posts
    76
    If your interest rate can vary according to all those things, I wouldn't go with a simple rate code, unless the code is meant to indicate a particular plan which specifies the type of loan, credit, promotion, period of loan, etc. If you want to be able to handle ad-hoc loans, it might be better to specify the values and rates for each of those variables separately.

  7. #7
    Join Date
    May 2013
    Posts
    6
    Thanks Reaanb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •