473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can't get many-to-many relationship to work

I don't know how to ask this question but I'll try:

I'm making a database (Access 2003) for an Opera buff. I have tables related like:

each Opera has many Productions (Madame Butterfly has an SF Opera production)
each Opera has many Roles (Madame Butterfly has Cio-Cio-San)
each Role has many Persons (Cio-Cio-San is played by Patricia Racette)

But the Person playing the Role depends on the Production. So, just like the program you get at the opera, I have a table Cast. Cast has foreign keys from Opera, Role, and Person.

I can't get my Cast queries to behave. I'm not surprised, because Cast is stuck in the middle and Opera is loose at the ends:

Opera > Production > Cast < Role < Opera

Not a very technical description but the relationship doesn't feel right. Cast is sort of fixing the many-to-many relationship between Production and Role (each Production has many Roles and each Role appears in many Productions). But having the same Opera table on the one side of both Production and Role I think messes things up.

If you understand what I'm trying to do and see a better way to do it, please let me know. Thanks!
Mar 1 '07 #1
1 2692
MMcCarthy
14,534 Expert Mod 8TB
tblOpera
OperaID (Primary Key - Autonumber)
OperaName

This table will contain a unique list of Operas

tblSinger
SingerID (Primary Key - Autonumber)
SingerName

Each singer will only appear once in this table.

tblProduction
ProductionID (Primary Key - Autonumber)
ProductionName
ProductionDate
OperaID (Foreign Key referencing the Primary key of tblOpera)

Each Production will be listed in this table.

tblRole
RoleID (Primary Key - Autonumber)
RoleName
OperaID (Foreign Key referencing the Primary key of tblOpera)

Each role will be listed in this table and reference the opera it's in.

tblCast
CastID (Primary Key - Autonumber)
SingerID (Foreign Key referencing the Primary key of tblSinger)
RoleID (Foreign Key referencing the Primary key of tblRole)
ProductionID (Foreign Key referencing the Primary key of tblProduction)

Now the cast consists of a singer, the role and the production.


Mary
Mar 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: GluedToTheScreen | last post by:
Pretty new to PHP, but learning fast... Can I somehow evaluate a variable as an operator? For example, if($someselection == 'EQ'){ $oper = '=='; }
1
by: Michel | last post by:
a site like this http://www.dvdzone2.com/dvd Can you make it in PHP and MySQL within 6 weeks? If so, send me your price 2 a r a (at) p a n d o r a . b e
3
by: Charley | last post by:
Where can I get MyPhpAdmin?
5
by: The Biscuit Eater | last post by:
Greetings from a second day newbie to php. I think I have figured out a way to explode a field in a csv file (like 11-08-03) and implode it as 031108 and then compare it to the current date(ymd)...
9
by: NotGiven | last post by:
I have a web page where certain pages have to be opened in a certain order and should only be available when the user openes them in HTTPS. They are all forms and the form action sends you to the...
2
by: I Report, You Decide | last post by:
I hate sessions on phpbb. can i delete it? how about invisionboard. does it use sessions? -- I am Social Liberal-Fiscal Conservative Social Liberal: Forgiveness, Acceptance of Difference,...
4
by: berehneh | last post by:
i have a site in a host with adomain i can run php with .php files but i can 't use php in .htm file. how can i do this
0
by: Jacques Bradet | last post by:
Can someone help me? I have tried php-4.3.4-installer I have tried php-4.3.4-Win32 If someone has PWS running PHP4 on windows 98 I would appreciate any help. thank-you
7
by: lawrence | last post by:
Given a bunch of mixes variables, I'm in a situation where I can't know what type they are. Can I use unset to kill an object? unset($object); Can I use unset to kill a pointer to an open...
2
by: live | last post by:
Can some one give me help? I need some information about: How can I compile php project on a executable and run it on CGI. Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.