Jump to content

Database tables relationship


josephbupe

Recommended Posts

Hi,

I am re-visiting my database table relationship for criminal incidents.

Six tables are involved plus a junction table to make it seven tables in total.
I need someone to review this relationship and advise whether or not it is correctly set up.

The relationships are as follows:

1. A person can belong to more than one incident:

t_persons (one-to-many) t)_incidents_persons


2. A person can only have one nationality by birth

t_persons (one-to-one) t_countries

3. An agency can have more than one incident

t_agencies (one-to-many) t_incidents


4. A status (e.g. closed incident) can belong to more than one incident

t_status (one-to-many_ t_incidents

5. A keyword (i.e. offence type eg theft)

t_offencekeywords (one-to-many) t_incidents

Link to comment
Share on other sites

First, a comment or three on your current model.

  1. Person table contains the country_id twice.
  2. Person table should not contain the country currency and currency code fields. They should only be in the country table.
  3. Country-person is a one-to-many relationship, not on-to-one (one country has many persons)

Notes on my model (I only included the key fields for brevity):

 

An incident will have several statuses over its lifetime. I included from and to dates so that historical data is available (how many open cases were there each month, for instance) The "to_date" field in the current status record would contain 9999-12-31. This enables you find the current status as the one where the current date is between the two dates in the record.

 

Is it possible that one agency is in charge of an incident but later an other agency takes control? If so you may need to take that same approach with the agency-incident relationship.

 

Incidents may require several keywords. For example, take the "Jack the Ripper" murders in 19th century London. Several incidents all with keywords "Murder, mutilation, prostitute"

 

post-3105-0-11486500-1411750592_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.