Question: I am new in PL/SQL for this reason sorry for easy question.I hope you will help me.

My goal is add values to table with for loop.If you have a question please replay I will answer as soon as posible.
This is my code which do not work.

```
declare
    cursor c_exam_info is select result1 from exam_info;
begin
    for i IN c_exam_info
    loop 
    if result1>60 then 
    insert into exam_info(result1) values('pass');
    else 
    insert into exam_info(result1) values('fail');
    end if;
    end loop;
end;

```

[this is my table](https://i.stack.imgur.com/9K1Vg.png)

Answer: 
I can't view images.

Anyway: `INSERT` seems to be inappropriate - wouldn't `UPDATE` be a better choice? Something like this:

```
begin
    for i IN (select id, result1 from exam_info) loop
      update exam_info set
        result_type = case when c_exam_info.result1 > 60 then 'pass'
                           else 'fail'
                      end
        where id = c_exam_info.id;
    end loop;
end;

```

Though, the same can be done in a SQL layer, you don't need PL/SQL (unless it is a homework so you're practicing PL/SQL).

```
update exam_info set
  result_type = case when c_exam_info.result1 > 60 then 'pass'
                     else 'fail'
                end;

```

It doesn't make much sense updating (or even inserting) the same column with a string ('fail' or 'pass') if that column (`result1`) is a number (e.g. 60). Also, what kind of a table is it - having only one column; what good would such an `INSERT` do (the one you wrote in your code)?
Given that the `result1` column appears to be completely computed data, I might even recommend here that you just use a view:

```
CREATE VIEW your_view AS (
    SELECT t.*,
        CASE WHEN t.result1 > 60 THEN 'pass' ELSE 'fail' END AS result1
    FROM exam_info t
)

```

Then, select from this view whenever you want to use the computed column. Computed/derived data should generally not be stored in your SQL tables, and also you should avoid using cursors, as database operations are already set based.