Showing posts with label heres. Show all posts
Showing posts with label heres. Show all posts

Friday, March 30, 2012

More Questions....Relationships

Ok heres the scenario:

3 tables

Movie - MovieID, MovieName, Starring1, Starring 2, Director

Director - MovieID, DirectorID, DirectorName

Actors - MovieID, ActorName

In bold are the names of the tables --

in bold+italic are the PK - Primary Keys.

Ive tried to create a relationship between:

1. Movie - MovieID to Director -MovieID - Movie is related to the director

2. Actors - MovieID to Movie-MovieID - Actor is related to Movie

Second relationship failed for some reason.

Im trying to achieve this result:

Movie = Pulp Fiction

Director = Quentin Tan

Actor = Sam L Jackson

Once i do reports etc.....What am i doing wrong here as i think its my relationships im having difficulty with?

Thank you in advance

try:

Select movieName,

DirectorName,

actorName

from movie m

join director d

on m.movieId = d.movieId

and m.movieName = 'Pulp Fiction'

and d.directorName = 'Quentin Tan'

join actor a

on m.movieId = a.movieId

and a.actorName = 'Sam L Jackson'

an alternative is:

Select movieName,

DirectorName,

actorName

from movie m

join director d

on m.movieId = d.movieId

join actor a

on m.movieId = a.movieId

where m.movieName = 'Pulp Fiction'

and d.directorName = 'Quentin Tan'

and a.actorName = 'Sam L Jackson'

|||Thanks but am i on the right lines about creating these relationships in the way i described or would you do anything differently?|||

Assuming that a movie has only one director, something like this:

Director -- DirectorID (PK), DirecorName

Actor -- ActorID (PK), ActorName

Movie -- MovieID (PK), MovieName, DirectorID

Cast -- MovieID, Order, Part, ActorID, (PK: MovieID, ActorID, Part)

The "Cast" table is necessary so that you can list all of the actors of the movie. I added in "Order" so that you can control "Promotion Order" or "Billing Order" or whatever you want to call it -- it is a control so that you can control the order in which the actors might be listed in credits.

I added in "Part" for movies in which somebody like Eddie Murphy might play multiple parts.

From my perspective the biggest problem here is the "Cast" table as I have made it. I still don't feel that it is general enough. For instance, say that you want to use this as the basis for listing movie credits. You want to include Producers, stunt coordinators, etc. It would be best to generalize the "Cast" table into a "Role" table and along the way establish "Subcategories" of the "Role" table. But now we are getting ahead of ourselves. This should get you started.

Monday, March 26, 2012

more database help.

Id greatly apperciate (like you guys have always helped when I needed it). heres my full content of ecommerce, Id like to make a search engine like amazon.com where there is a pull down menu, and you can search from particular catagories my catagories are : (and there are many subcatagories)

1) Wheels/Tires
brands - 20 or so
2) Exterior
- body kits
-wings
-headlights
-taillights
-etc.
3) Interior
racing seats

4) Suspension/Brakes
air bags
coilovers
lowering springs
shocks
5) Performance
Intakes
Exhausts
Headers
NOS
Turbo Chargers
Super Chargers
6) Car Audio / Video
20 or so brands
ie
pioneer
jl audio
6) Accessories
battery tie down

what databases should I make for the search engine?
do i need to make a .aspx file that would retrieve this information?
if so, what info would I put in this file?
what relationships would the databases have?

2nd question -

to create a database for my product catalog / Shopping cart :

what databases do I create?
what type of relationships will they have?
is there a .aspx file that needs to be created?
if so, what info and where do I put it on the ftp?can anyone help me?