If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Simple design question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-05, 00:50
nepatriotsxxxvi nepatriotsxxxvi is offline
Registered User
 
Join Date: Dec 2005
Posts: 3
Simple design question

I am a beginner designing a simple database.

This is what I have so far:
There is a table that has a list of companies. There is a table that has a list of users with their names, passwords, company they belong to. I have a login set up on the website which uses these tables.

Here is what I need to add:
Each user will have a set of data which consists of a number of claims. A claim will have a short description, its amount, and its date.

This is a relatively small project. Each user will have at most 100-120 claims per year (this data is only relevant for a year at a time). There are usually between 1 and 50 employees per company, and about 20 companies.

What is the best way to store the claims? I was thinking a table for each company filled with the claims for its corresponding users? I guess other options are just one table with all the claims, or a sperate tabel for each user. Any adivce would be appreciated.

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-22-05, 00:57
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
Think about it this way:

Companies are an entity

Users are an entity

Claims are an entity

You don't need separate tables for an entity.
__________________
visit: relationary
Reply With Quote
  #3 (permalink)  
Old 12-28-05, 17:53
nepatriotsxxxvi nepatriotsxxxvi is offline
Registered User
 
Join Date: Dec 2005
Posts: 3
hmmm, so how should I set it up then? Are you suggesting all 1 table?
Reply With Quote
  #4 (permalink)  
Old 12-29-05, 02:39
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
nepatriotsxxxvi
that's not really the question is it

How do you think it should be set up?

Certus have given you some ideas on the entities as he sees it.

Analysing your problem, how do you see the entities

How do you see the realtionship between entities

How much complexity do you perceive in the real world, and how much of that complexity have you got to represent in your model?
Reply With Quote
  #5 (permalink)  
Old 01-10-06, 20:12
nepatriotsxxxvi nepatriotsxxxvi is offline
Registered User
 
Join Date: Dec 2005
Posts: 3
Alright, that pretty much solves my problem. Lets review what I've learned so far....

...

...

nothing

GREAT!
Reply With Quote
  #6 (permalink)  
Old 01-10-06, 20:13
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Quote:
Originally Posted by nepatriotsxxxvi
Alright, that pretty much solves my problem. Lets review what I've learned so far....
So, when is the assignment due?

-PatP
Reply With Quote
  #7 (permalink)  
Old 01-10-06, 20:54
rehack rehack is offline
Registered User
 
Join Date: Jan 2006
Posts: 18
i was about to blurt out a solution, then i thought of a complication i couldn't immediately think around:

what would be a good way to allow users to switch companies, or be under multiple companies, while retaining which company a user was with for each claim? normalized of course. just adding company_id to each claim alongside the user_id seems.. wrong.

how about an employment table that tracks which company a user was under for a given time period, such as
Code:
table employments:
employment_id
company_id
user_id
start_date
end_date
that way a claim would reference an employee_id, users could be in multiple companies or change companies, but for a given claim you'd still know the user and company responsible.

is that on a better track?
Reply With Quote
  #8 (permalink)  
Old 01-11-06, 11:05
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Quote:
Originally Posted by nepatriotsxxxvi
Alright, that pretty much solves my problem. Lets review what I've learned so far....
Hmmm... let's review what you've paid us to spoon-feed you answers amounts to so far...

Quote:
Originally Posted by nepatriotsxxxvi
nothing

GREAT!
Depth of your effort = Depth of our answers

The sooner you grasp that the better.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On