I'm brand new to SQL and mySQL workbench. I'm trying to get the one to many relantionship from team_id to home_id and the one to many relantionship from team_name to visitor_id. I cannot get the relantionships when reverse engineering the database. How do I create these relantionships.
THis is how I created the tables. I would think the REFERENCES would created the relantionship.
CREATE TABLE TEAM (
team_id INT PRIMARY KEY,
team_name VARCHAR(255),
team_mascot VARCHAR(255)
);
CREATE TABLE GAME (
home_id INT,
visitor_id INT,
FOREIGN KEY (home_id) REFERENCES TEAM(team_id),
FOREIGN KEY (visitor_id) REFERENCES TEAM(team_id)
);
Thank you for the Help