Yes, a variable can be assigned a value from a database. You can fetch the value from the database and assign it to the variable using the into keyword, as shown in the following code:
select emp_sal * 0.20 into var_increment from
t_emolovee where emo_no = emo_id