What is the best way to create the tables relationships like one to many, many to many in magento 2? Specifically between a custom table created for a module and a system-defined table like Products table.
Thanks in advice.
Solved! Go to Solution.
You can define relationship between tables in a usual way, using foreign keys.
How to add a foreign key to a database table: https://mage2.pro/t/569
thanks for your response. Another question, when I have to get data from the relationship (join between the tables) is there a way to use Magento Framework or should I make a query in database using zend framework?
Magento uses its own classes inherited from Zend Framework classes.