title: SQL Query For Values From Another Table
body: <p>I have a team_name column but I want to instead store the team_IDs of the same teams from column (team_ID) in a different table to use as a foreign key and then drop team_names. Here are some screenshots</p>
  <p>The table I have (players):
  <a href="https://i.stack.imgur.com/4fTtk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4fTtk.png" alt="enter image description here" /></a></p>
  <p>The table I want to get the values of team_ID from (teams_in_league):</p>
  <p><a href="https://i.stack.imgur.com/89i5H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/89i5H.png" alt="" /></a></p>
  <p>For each row where team_ID is null, I want that to be the ID of the team_name contained in the next column. What query can I use to achieve this? Team_ID is meant to be a foreign key btw</p>
  <p>EDIT:
  Extra info: there should be two tables, I'm going to add more columns to the second table. That's why I'm not joining the two tables.</p>