Jump to content

Recommended Posts

After following several tutorials I still can't grasp the concept of relational databases. I was able to learn and understand advanced techniques and how to query simple data from tables but when it comes down to linking tables, for example topics with certain categories, I get lost.

 

I'm desperately asking for a noob-proof relational DB tutorial, if anyone knows one.

Link to comment
https://forums.phpfreaks.com/topic/202400-a-good-relational-database-tutorial/
Share on other sites

Thanks for the link! The tutorial was a little difficult to follow but i dissected  the whole process on paper from my own noob perspective than compared it to how it's actually done and it matches :) I'm finally starting to understand db relations.

 

I have just one question if you don't mind.. For example I have a table for movie genres and another for movie titles.. and I want to query each title under its appropriate genre.

 

In movie genres I have 2 columns:

 

genre_id (primary, a.i)

genre_name

 

and in movie titles:

 

movie_id (primary, a.i)

genre_id (foreign key)

movie_title

 

I make my databases in phpmyadmin. For the foreign key "genre_id" is there something I need to do in phpmyadmin?

 

Apparently you didn't follow the tutorial thoroughly:

 

movie_id (primary, a.i)

genre_id (foreign key)

movie_title

 

It's not uncommon for a movie to fit under multiple genre's like IMDB shows you.

 

http://www.imdb.com/title/tt1228705/

No, I was actually referring to a many-to-many relationship as:

 

- one genre has many movies and

- one movie has many genres

 

And yes I get paid by Marvel to SPAM that link everywhere and tell everyone how awesome that video, just for doing so I get 1K for every referral. I only just hit $1M ;)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.