I have 2 tables with a join table. Here is my schema.
SOLDIERS SOLDIER_ID integer FIRST_NAME varchar(50) LAST_NAME varchar(50) RANKS RANK_ID integer NAME varchar(50) SOLDIER_RANKS SOLDIER_ID integer RANK_ID integer I am trying to insert a row into the SOLDIER_RANKS table. I know the id of the SOLDIER and I know the name of the RANK. Here is what I have tried, but I can't figure out how to hard code the SOLDIER_ID.
INSERT INTO SOLDIER RANKS(SOLDIER_ID, RANK_ID) // Here I need to specify that SOLDIER_ID = 1 SELECT RANK.RANK_ID WHERE RANK.NAME = 'COLONEL'; How do I make this work?