Jump to content

What Database The Better?


phpnoob

Recommended Posts

YoI want to make a reviews and a genre database for itI think three exampleExp1(Reviews table)(Column)id | Genreid(Value ) 10| 10(Genre table)(Column)id|Genretype1|Genretype2|Genretype3|Genretype4|etc(Value )10|Type1 |Type2 |Type3 |Type4 |etc"you must create new value for every reviews"Exp2(Reviews table)(Column)id | Genreid(Value ) 10| 10(Value ) 11| 11(Genre table)(Column)id|Genretype|(Value )10|Type1 |(Value )10|Type2 |(Value )10|Type3 |(Value )10|Type4 |(Value )11|Type2 |(Value )11|Type3 |(Value )11|Type4 |etc"you must create new value for every reviews"Exp3(Reviews table)(Column)id | Genreids(Value ) 10| 01,02,03,10,34(Value ) 11| 02,05,06,10"explode"(Genre table)(Column)id|Genretypes|(Value )01|Type1 |(Value )02|Type2 |(Value )03|Type3 |(Value )04|Type4 |(Value )05|Type5 |(Value )06|Type6 |(Value )10|Type10 |(Value )34|Type34 |"the values are fixed, no need to create new value for new reviews"Plan for genre database-Moderator system "modifying or delete 1 genre name (1 or all) ""modifying the review genre list or delete it"-Title database for Genre type-Searching genre for what reviews have that genre, multiple genre search!

Link to comment
Share on other sites

Lots of brainstoring around here...I suggest you work out exactly what you want the full application to do, then create the database around it. Determine what stuff should potentially be addable, and what should be a constant, what is connected to what (e.g. a genreid column in a review table will be connected to the genreid table in the genre table if you want to make reviews for each genre), etc.Right now, it doesn't seem clear to me what is the goal. Do you want to make a review for a genre? You know, like "Sci-fi is a great genre... btw, Battlestar Gatactica sucks"... seems out of place to me. See the quote for a sample of why that is.

Link to comment
Share on other sites

If you have a many-to-many relationship between reviews and genres (i.e., if one review can have many genres, and one genre can be part of many reviews), then you need a review table with the ID of the review and whatever other review data you have, a genres table with the ID and title of each genre, and a review_genres table with columns for the ID of the review and the ID of the genre. If you have a one-to-many relationship (i.e. if one review can have only one genre, but each genre can apply to many reviews), then you can just have a genre column in the review table. You would probably still want to have a lookup table which maps genre IDs to titles though. You could also have a one-to-one relationship, but that wouldn't make sense in this case. That would mean that each review can only have one genre, and each genre can only apply to one review.

Link to comment
Share on other sites

If you have a many-to-many relationship between reviews and genres (i.e., if one review can have many genres, and one genre can be part of many reviews), then you need a review table with the ID of the review and whatever other review data you have, a genres table with the ID and title of each genre, and a review_genres table with columns for the ID of the review and the ID of the genre. If you have a one-to-many relationship (i.e. if one review can have only one genre, but each genre can apply to many reviews), then you can just have a genre column in the review table. You would probably still want to have a lookup table which maps genre IDs to titles though. You could also have a one-to-one relationship, but that wouldn't make sense in this case. That would mean that each review can only have one genre, and each genre can only apply to one review.
Right now on MYSQL have 70 genres, so i need 1 review table and 1 genre table
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...