Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS Access
 Opinions on DB table
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 02 May 2001 :  12:10:56  Show Profile  Send e3stone an AOL message
I'm building a db table(s) to store information about movies that are being shown at local theatres. I can't decide what the best table set-up would be. Here's my idea. Have one table that stores the Theatre info (name, address, tele, etc), then have another table that stores movie details (name, rating, actor/actresses, length, director, etc) Now, the key point that I'm stuck on is what would be the best way to link the individual movie to the theatre? have a seperate table that has a "theatre_id" and "movie_showing_id" fields?? or should I have a yes/no field in the movie detail table, i.e. have a field called "starplex" (a type of theatre) and check yes if the movie is playing there? Any ideas that would point me in the right direction would be great

<-- Eric -->


http://insidewaco.com/forum

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2001 :  12:33:21  Show Profile  Visit HuwR's Homepage
since this is likely to be a many to many relationship, you should use a link table to store the theatre/movie id's

Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 02 May 2001 :  13:22:30  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Like Huw suggest, I would use something like this:

Theatre: TheatreID, Name, Type, Seats, etc...

Movie: MovieID, Name, Rating, Length, etc...

Movie_Theatre: TheatreID, MovieId

This is very similar to the way forum_moderators is set up currently....

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 02 May 2001 :  14:01:50  Show Profile  Send e3stone an AOL message
Alright, I'm following you on the design, yet I'm still confused as to where I'd store the information about the times that the movie is playing at a particular theatre. You can look at this page for an example of what I'm wanting to do. http://www.insidewaco.com/forum/amazon_images/movies_beta.asp

<-- Eric -->


http://insidewaco.com/forum
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2001 :  15:28:40  Show Profile  Visit HuwR's Homepage
you would be best to store this in a seperate table and have it's id in the link table, since it is specific to a particular movie/ theatre

so your link table would be

theatreid/movieid/screentimeID

I would do it this way since the number of screenings will vary depending on the theatre/movie combination


Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 02 May 2001 :  16:49:13  Show Profile  Send e3stone an AOL message
Alright, so my relationship table should look like this?: http://insidewaco.com/movie_database.gif

I'm just learning about database design and details of relationship within them. What exactly is the link table for? are each of the fields in the link table a primary key of that table? So, in this example the link table would have three primary keys?

<-- Eric -->


http://insidewaco.com/forum
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2001 :  18:10:42  Show Profile  Visit HuwR's Homepage
looks good, basically the link table is used when you have a many to many relationship, to store those relationships it allows you to define things like

a movie can be shown in multiple theatres and a theatre may show multiple movies, by simply storing the links, and yes you are correct every record in the link table will be unique and have a "three field" primary key definition

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07