473,769 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple DB Design Question

I was going to design a simple movie database, but I'm just stuck in
the very begining.

It will contain the following information.

Country, Movie, Plot, Actors
So, I created tables like below.
tbl_Countries ( countryID, Country_Name )

tbl_Movies ( movieID, Title, Year_Released, countryID )

tbl_Actors ( actorID, Name, DateOfBirth, countryID, MovieID )

Now the problem with my design above is that it would require me to
add multiple records of same actor if the actor starred in many
movies.

How should I design this database? I'm so hopeless.
Nov 18 '08 #1
4 1754
Change your tables a small bit and you got it!

TblCountry
CountryID
CountryName

TblActor
ActorID
ActorFirstName
ActorLastName
DateOfBirth
CountryID

TblMovie
MovieID
Title
YearReleased
CountryID

TblMovieActor
MovieActorID
MovieID
ActorID

You need a main form based on TblMovie to enter movies and a subform based
on TblMovieActor to enter all actors in that movie.

Steve
<gn********@gma il.comwrote in message
news:2e******** *************** ***********@k24 g2000pri.google groups.com...
>I was going to design a simple movie database, but I'm just stuck in
the very begining.

It will contain the following information.

Country, Movie, Plot, Actors
So, I created tables like below.
tbl_Countries ( countryID, Country_Name )

tbl_Movies ( movieID, Title, Year_Released, countryID )

tbl_Actors ( actorID, Name, DateOfBirth, countryID, MovieID )

Now the problem with my design above is that it would require me to
add multiple records of same actor if the actor starred in many
movies.

How should I design this database? I'm so hopeless.

Nov 18 '08 #2
well, you started off pretty well, just went off the rails a bit toward the
end there. comments inline.
<gn********@gma il.comwrote in message
news:2e******** *************** ***********@k24 g2000pri.google groups.com...
I was going to design a simple movie database, but I'm just stuck in
the very begining.

It will contain the following information.

Country, Movie, Plot, Actors
So, I created tables like below.
tbl_Countries ( countryID, Country_Name )
okay.
>
tbl_Movies ( movieID, Title, Year_Released, countryID )
good, including the foreign key countryID from tbl_Countries.
>
tbl_Actors ( actorID, Name, DateOfBirth, countryID, MovieID )
whoa, here's where we start to hear that scary screeching sound. you put all
the countries in one table, and the fields in the table describe a specific
instance of a country (in this case, just ID and name). you put all the
movies in a table, and the fields in the table describe a specific instance
of a movie (the country that the movie was made in - or released in,
whatever - is descriptive of the movie, too). so put all the actors in one
table *where all the fields describe a specific actor*. countryID fits the
bill, IF you're talking about the country the actors was born in, or lives
in, whatever; the point is that the country info in this table must describe
an actor. but a movieID, that doesn't describe an actor at all, so it
doesn't belong in this table.

you have to analyze the relationships between the real-world entities. one
movie may include many actors (of course), AND one actor may act in many
movies (unfortunately, in some cases!). there's the definition of a
many-to-many relationship, right there. in Access, a many-to-many
relationship is represented by using a linking table, with each of the
primary tables having a one-to-many relationship to the linking table, as

tblMovieActors
MovieActorID (primary key)
movieID (foreign key from tbl_Movies)
actorID (foreign key from tbl_Actors)

the relationships are:

tbl_Movies.movi eID 1:n tblMovieActors. movieID
tbl_Actors.acto rID 1:n tblMovieActors. actorID

and there you go. each record in tbl_Movies describes one instance of a
movie; each record in tbl_Actors describes one actor. each record in
tblMovieActors describes a specific actor in a specific movie. does the
movie have 10 actors? this table will have 10 records for that movie, each
one including one of the 10 actors. did so-and-so actor make 18 movies? the
table will have 18 records for that actor, each one including one of the 18
movies.

suggest you read up/more on relational design principles. for more
information, see
http://www.accessmvp.com/JConrad/acc...abaseDesign101.

hth

>
Now the problem with my design above is that it would require me to
add multiple records of same actor if the actor starred in many
movies.

How should I design this database? I'm so hopeless.

Nov 18 '08 #3
Wow, thank you very much Tina and Steve.
That have helped me a lot.

Thanks again.
Nov 19 '08 #4
you're welcome :)
"gnewsacces s" <gn********@gma il.comwrote in message
news:41******** *************** ***********@35g 2000pry.googleg roups.com...
Wow, thank you very much Tina and Steve.
That have helped me a lot.

Thanks again.

Nov 19 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3698
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example program #include <list>
51
8290
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct code? many thx!
2
8403
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
17
19309
by: RSH | last post by:
I am really trying to grasp the concept of OOP as it applies to C#. I am looking at trying to set up a simple Employee Class but I am having trouble conceptualizing what this class should look like. I was hoping someone might be able to simply outline what I envision my class to look like: Basically I am envisioning a Class called Employee: I imagine it would have many properties(?) such as:
4
4388
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state machines in C# where the machine can use the enumerated 'state' to execute (thus the term 'machine' as in 'state machine') the machine operations as this requires boolean operations to be performed on the state. .....
176
8456
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
7
1808
by: CSharper | last post by:
Yesterday I had a heated discussion with my colleagues on what is a data centric application and having business logic in sql. I have group of people who wants to include all the business logic in the sql stored proc and I for one consider to have most of the business logic in the C# code (specifically in a controller class of MVC). These are my points to them. 1. Our application depends a lot on the data and we have huge amount of data...
17
5818
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /* Simple Thread Object ______________________________________________________________*/ #include <pthread.h> extern "C" void* thread_entry(void*);
2
3527
by: nicholas08 | last post by:
I am new to programming and trying to work on a simple console app. I am making a simple Library Management system where the user/admin can manage members and item. Attaching the menu so it's clear to understand what I am saying. http://i475.photobucket.com/albums/rr116/nicholasCsharp/Untitled.jpg So far I have only looked at Item and Member Management (option 1 and 2) Few question I had: 1. In terms of the design approach I am taking. One...
0
9420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7401
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.