this is a programming challenge I've undertaken to learn some MySQL fundamentals and I can't figure out how to implement a one-to-many relationship in the manner I need. See the below code:
CREATE TABLE Product ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, price FLOAT(7,7) NOT NULL, needed_for_bundle INT(2) NOT NULL ) CREATE TABLE Bundle ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, price FLOAT(7,7) )
I can't find anywhere how to do this or I'm just not understanding the examples I've found that were similar. If these were python objects, I would have a list of product IDs in the bundle table/object that reference the 3-4 items in the bundle. I know this is a one-to-many relationship but I'm not understanding lexically and theoretically how it would work in MySQL.
Help would be much appreciated. Thank you all.