title: Cursor to gain the number of cars each person owns
body: <p>I am a new with Oracle and DBMS and I have two tables CAR_OWNER and CAR. I am trying to get the number of cars each person owns by using Cursor and loop but should I do I by Join? or there is a specific function to do that?.
  Below is my code:</p>
  
  <pre><code>declare 
      v_PNR CAR_OWNER.PNR%TYPE;
      i  NUMBER;
  
      cursor c_custcell is
          select First_name, Last_Name, PNR from CAR_OWNER;
  begin
      i:=1;
  
      if not (c_custcell%isopen) then
          open c_custcell;
      end if;
  
      loop
          i := i +1;
          exit when i = 11; 
  
          fetch c_custcell into v_First_name, v_Last_name, v_PNR;
          exit when c_custcell%notfound;
  
          dbms_output.put_line(''||initcap (v_First_name)||',  '||initcap (v_Last_name)||',   '||v_PNR||',   '||i||','); 
  
      end loop;
  end;
  /
  </code></pre>