how to normalize the table?
Can someone show me the easiest way to normalize this table? I'm having trouble figuring out how to group relationships.
Film# Title Dir# DirectorName Actor# ActorName Role Timeon
F1100 Happy Day D101 Jim Alan A1000 Judy Foster Amy Jones 50
A1001 Robert Dinero Harry 30
开发者_StackOverflow A1004 Harrison Ford Jack Actress 55
A1009 Eddy Murphy Excel Fuse 65
A1000 Judy Foster Amy Jones 15
F1101 AirForceOne D105 Woody Ellen A1000 Judy Foster Amy Jones 50
A1004 Harrison Ford Bill Ford 55
A1009 Eddy Murphy Police one 35
A1002 Mary Jackson Police two 45
F1102 RunAwayBride D101 Jim Alan A1003 Julia Roberts Amy Jones 50
A1007 David Lynch Sam Strickland 45
A1004 Harrison Ford Robber 35
A1005 John Wayne Cab Driver 25
A1000 Judy Foster News Reporter 65
You need two data tables, Film and Person, and two intersection tables, FilmDirector and FilmRole. An abbreviated example:
Film
filmID title
1100 Happy Day
1101 Airforce One
1102 Runaway Bride
Person
personID name
101 Jim Alan
105 Woody Ellen
1000 Judy Foster
1001 Robert Dinero
1002 Mary Jackson
1003 Julia Roberts
1004 Harrison Ford
1005 John Wayne
1007 David Lynch
1009 Eddy Murphy
FilmDirector
filmDirectorID filmID personID
1 1100 101
2 1101 105
3 1102 101
FilmRole
filmRoleID FilmID personID role timeOn
1 1100 1000 Amy Jones 50
2 1100 1001 Harry 30
3 1100 1004 Jack Actress 55
6 1101 1000 Amy Jones 50
7 1101 1004 Bill Ford 55
...
精彩评论