Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Relational Data Base Design

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys what you think its the best solution for this scenario, where i have these three tables. I want to relate the tbl_client with the tbl_checkingAccount and tbl_SavingAccount.
If I have one table to related them, the foreign key of the agregated table would come from two diferent tables. What way i found was to have two tables, agregating the tblClient - tblCheckingAccount, and another one tblClient - tblSavingAccount.
The problem is, those tables have the same attributes, the only diferente is where the foreign key comes from.






 
Marshal
Posts: 26308
80
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the world I live in, a client can have a savings account. And a client can have a checking account. Or both. Or more than one of each. Any of those would then (naturally) be linked to the client that owns them.

In your world, though, a checking account can't exist without a savings account to link it to. Perhaps that's a reflection of reality where you live? But anyway, if that's the requirement then the savings account must be linked to the client who owns it. There's no need to link a checking account to a client because it's owned by the owner of the savings account which it's linked to.
 
I've been selected to go to the moon! All thanks to this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic