Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One-to-One Relation or Use the Same Table?

I have the following tables created:

Animes(id,title,date), Comics(id,title,date), TVSeries(id,title,season,episode,date)

Some of them have already foreign keys (for one-to-many or many-to-many relations) of directors, genres, articles and so on.

Now i would like to create two more tables Reviews(id,rating,date) and Posts(id,thumbid,articleid,reviewid). A review is about one Anime and/or Comic TVSerie and vise-versa but properties of a review may be in more than one table. Its the same about a posts.

Is this a typical example of one-to-one relation in separate table or is it more efficient to add more properties to the existing tables? So more tables and relations or less tables more columns?

Thank you and i hope my question isnt that stupid but im a bit confused.

like image 788
fat_mike Avatar asked Nov 22 '12 10:11

fat_mike


1 Answers

In my view, It is better to avoid foreign key relationship for one-to-one relationship. It is best suitable for one - many relationships.

like image 187
Chella Avatar answered Oct 02 '22 14:10

Chella