We Talk Coding

Databases: How to link an Account table with a Savings table and a Current table?

Hi all! Databases question this time - I'm trying to build an ER diagram, and basically came up with this: SAVINGS 1 ------------------ 1 ACCOUNT 1 ------------------ 1 CURRENT While I know this isn't the most strategic approach, does this mean that if I create an account I'd need BOTH a Savings and a Current, or can it just mean 'either or'? Thanks :) I'll rephrase it: I have three tables: ACCOUNT, SAVINGS and CURRENT - trying to model a simple bank system. I'd like to know what relationships to put between account and savings AND account and current; right now I have one-to-one relationships on both ends. What I was wondering is, if account is related to BOTH savings AND current, how can I make it so that IF one of the tables is filled out, the other CANNOT be? :)

Public Comments

  1. The entities are fields, not tables. Define your fields - remember to normalize.
  2. what you indicated above "SAVINGS 1 ------------------ 1 ACCOUNT 1 ------------------ 1 CURRENT " it means to say that their should be a savings account to have an account and the account should be a current account. You actually answered your own question. Give yourself the points. You can link these tables with relationships. like 1...0(one is none relationship), 1....1(one is to one) or 1....*(one is to many)
Powered by Yahoo! Answers