in reply to Normalisation Question (OT but trust me, perl implementation)

I had a similar Problem. I have a collection of Video tapes: Movies, Star Trek episodes and so on:

There are, relevant for your problem, the tables:

PERSONS, PERSON_TITLE, TITLES, CONTRIBUTORS

Sometimes you have persons as actors in one episode and as director in another.

Examples:

PERSONS
+------+------------+---------------+
| prNR | prLASTNAME | prNAME |
+------+------------+---------------+
| 76 | McNeill | Robert Duncan |
+------+------------+---------------+

PERSON_TITLE

+-------+------+------+------+
| PT_NR | prNR | ttNR | cnNR |
+-------+------+------+------+
| 542 | 76 | 242 | 2 |
+-------+------+------+------+

cnNR stands for the number in CONTRIBUTORS.

This table looks as follows:
+------+-----------------+
| cnNR | cnFUNCTIONALITY |
+------+-----------------+
| 1 | Actor |
| 2 | Director |

Table Titles

+------+----------------------+------+
| ttNR | ttTITLE | dtNR |
+------+----------------------+------+
| 242 | Voyager - Das Ritual | 30 |
+------+----------------------+------+
(dtNR gives just the number of the Datacarrier and doesn't
bother here).

In this episode Duncan McNeill is actor and direktor as well.

So you can guess how the PERSON_TITLE set might change:

+-------+------+------+------+
| PT_NR | prNR | ttNR | cnNR |
+-------+------+------+------+
| 527 | 76 | 242 | 1 |
+-------+------+------+------+

Your solution: you only need a further Field in your actors_role table.

I hope this was a bit helpful. Sorry, having watched Star Trek in Germany, I have only the German episode names.

  • Comment on Re: Normalisation Question (OT but trust me, perl implementation)