title: How to divide integers in Oracle SQL to produce floating point numbers?
body: <p>I have just started learning Oracle SQL. I am trying to divide two columns of <code>numeric</code> datatype which is same as an integer, I think. I want to create a new column in the table or <code>float</code> data type, divide an existing <code>numeric</code> column by an integer and put its value into the <code>float</code> column. I am using this code for the division and updating part:</p>
  
  <pre><code>update Student set AVERAGE = TOTAL/3;
  </code></pre>
  
  <p>Here, <code>TOTAL</code> is the <code>numeric</code> column and <code>AVERAGE</code> is <code>float</code>. But when I print the table using: </p>
  
  <pre><code>select * from Student;
  </code></pre>
  
  <p>, <code>AVERAGE</code> is shown with rounded values of the division. I tried two solutions that I found on the internet:</p>
  
  <pre><code>update Student set AVERAGE = (TOTAL*1.00)/3;
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>update Student set AVERAGE = cast(TOTAL as float(2))/3;
  </code></pre>
  
  <p>But both are not working. What am I doing wrong?
  Here is the output I am getting:</p>
  
  <pre><code> ROLL_NO SNAME                MATHS       CHEM        PHY      TOTAL    AVERAGE
  ---------- --------------- ---------- ---------- ---------- ---------- ----------
         101 abcd                    56         68         80        204         70
         102 efgh                    81         78         70        229         80
         103 ijkl                    69         73         78        220         70
         104 mnop                    90         89         92        271         90
         105 qrst                    80         89         79        248         80
  </code></pre>