sub-query
for INSERT
statement.
Before inserting the record, sub-query
gets gender_id
based on the provided gender nameINSERT INTO students (
first_name,
last_name,
points,
gender_id
)
VALUES (
'ილია',
'დავითაშვილი',
'84',
(SELECT id FROM genders WHERE name = 'Male')
)