I want to store data on different machines in a MySQL database, which includes both piston and rotary engines.
In OO languages, I can create and extend a superclass of a class Engineto get subclasses of PistonEngineand RotaryEngine.
The subclass PistonEnginewill contain properties such as CylinderNo, PistonBore, and PistonStroke.
The subclass RotaryEnginewill contain properties such as RotorThickness and RotorDiameter.
In MySQL, although I can create two separate tables for reciprocating and rotary engines, respectively, I would prefer to maintain the EngineType field as part of the engine data and store all the data common to both types of engines in a single table.
How can I create my database to avoid data redundancy as much as possible?
Zaid source
share