I've got several tables that have common data in them. I'm coming from an object orientated programming background so i've made a "parent" table with the common fields and then setup a relationship between it and the "child" tables. I'm thinking this may not be the optimal design for database's as your always going to need to get two tables when you interact with the data. Can anyone give any feedback on this issue as from a design point of view it's cleaner to have them separated up but that's the only reason i can give to do it that way.
So we've got three tables. In object orientated programming you'd have a parent class "Animal" and then two sub class's "Dog" and "Rabbit". Should i in my database schema also have three tables as above or should i have two tables like this
Table : Dog
Fields : Id, Name, NumOfLegs, IsCarnivore
For sure in the case of the animals your right it would be better off in a single table however this isn't a real world example as in i was just showing where i was coming from in my thinking.
So the original question was if it's not possible to combine all into one table then am is there a performance penalty on having the separated out tables in mysql or is it so insignificant that i can do what i've done at the moment and separate them out so as to have a cleaner design.