mysql how to insert into a value within a table code example
Example 1: fk in insert mysql
INSERT INTO joke(joke_text, joke_date, author_id)
VALUES (‘Humpty Dumpty had a great fall.’, ‘1899–03–13’,
(SELECT id FROM author WHERE author_name = ‘Famous Anthony’));
Example 2: insert into table from another table mysql
INSERT INTO table1 (emp_id, fname)
SELECT emp_id, fname
FROM table2
WHERE status = 'Active';