RDB Example 2
This example is about users of a discussion board.
We have data about the users. For each user, we know the following:
- User ID
- Last Name
- First Name
- Account Number
- Password
- Password Renewal Date
We know that:
- An account has a unique User ID.
- A user could have more than one account.
- An account belongs to only one user.
- Accounts all have different Account Numbers.
- An account has one password and on Password Renewal Date.
- Two users might have the same Last Name or the same First Name.
- Two users might be using the same password.
- Two users might have the same Password Renewal Date.
The most powerful piece of information seems to be the Account Number,
but some items depend on the User ID.
We can organize this into two tables:
Table A may contain fields:
- User ID (primary key)
- Last Name
- First Name
Table B may contain fields:
- Account Number (primary key)
- User ID (foreign key)
- Password
- Password Renewal Date