How to fill a foreign key column with id values from another table? The first thing I did was create a table
CREATE TABLE my_list (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(20), last_name VARCHAR(20)); Then it was necessary to add the int_id foreign key of the interests
ALTER TABLE my_list ADD int_id INT, ADD CONSTRAINT FOREIGN KEY(int_id) REFERENCES interests(int_id); An int_id column is int_id with NULL values.
Question - Is it possible to fill the int_id column in the my_list table my_list all the values from the int_id column of the interests table?
I tried to do something like this:
UPDATE my_list SET int_id = (SELECT int_id FROM interests) But it does not work.
For example, I filled out the prof_id foreign key as follows:
UPDATE my_list SET prof_id = CASE WHEN id = 1 THEN 1 WHEN id = 2 THEN 2 // и т.д END; But if in my table there will be 1000 records. It will be very tedious to fill out. I am new to SQL , so I still don’t know much. Thanks in advance for the tips.

int_idin themy_listtable? For example, an entry withid=7 (Carla)whichint_idshould it be? - Novitskiy Denis