Fibonacci Series using pl/sql

1. Write pl/sql code to generate Fibonacci Series and save the series into a table.

2. Generate Fibonacci Series using a PL/SQL user defined Function

22 comments:

  1. Id:201330499

    1 declare
    2 a number(5):=0;
    3 b number(5):=1;
    4 fib number(5):=0;
    5 i number(5);
    6 begin
    7 for i in 0..10 loop
    8 fib:=a+b;
    9 dbms_output.put_line('seris is='||fib);
    10 a:=b;
    11 b:=fib;
    12 end loop;
    13 end;
    14 /

    ReplyDelete
  2. Name:Fatema binte Shakir
    ID:201410038
    1 declare
    2 a number(5):=0;
    3 b number(5):=1;
    4 fib number(5):=0;
    5 i number(5);
    6 begin
    7 for i in 0..10 loop
    8 fib:=a+b;
    9 dbms_output.put_line('seris is='||fib);
    10 a:=b;
    11 b:=fib;
    12 end loop;
    13 end;
    14 /

    ReplyDelete
  3. declare
    a number(4):=0;
    b number(4):=1;
    c number(4):=0;
    i number(4);
    begin
    dbms_output.put_line(a);
    dbms_output.put_line(b);
    for i in 3..20 loop
    c:=a+b;
    dbms_output.put_line(c);
    a:=b;
    b:=c;
    end loop;
    end;
    /

    ReplyDelete

  4. 1 declare
    2 x number(5):=5;
    3 y number(6):=6;
    4 z number(7):=5;
    5 f number(5);
    6 begin
    7 dbms_output.put_line(x);
    8 dbms_output.put_line(y);
    9 for f in 0..10 loop
    10 z:=x+y;
    11 dbms_output.put_line(z);
    12 x:=y;
    13 y:=z;
    14 end loop;
    15 end;
    /

    ReplyDelete
  5. 1 declare
    2 a number(5):=&a;
    3 b number(6):=&b;
    4 c number(7):=&c;
    5 f number(5);
    6 begin
    7 dbms_output.put_line(a);
    8 dbms_output.put_line(b);
    9 for f in 0..10 loop
    10 c:=a+b;
    11 dbms_output.put_line(c);
    12 a:=b;
    13 b:=c;
    14 end loop;
    15 end;
    /

    ReplyDelete
  6. declare
    num1 number(5):=0;
    num2 number(5):=1;
    fibo number(5):=0;
    j number(5);
    begin
    for j in 0..10 loop
    fibo:=num1+num2;
    dbms_output.put_line('fibonacci series is:' ||fibo
    );
    num1:=num2;
    num2:=fibo;
    end loop;
    end;
    /

    ReplyDelete
  7. declare
    a number(2);
    b number(2);
    fib number(5);
    begin
    a:=0;
    b:=1;
    for i in 1..10 loop
    fib:=a+b;
    dbms_output.put_line(fib);
    a:=b;
    b:=fib;
    end loop;
    end;

    ReplyDelete
  8. declare
    n number(5);
    i number(5):=0;
    next number(5);
    first number(5):=0;
    second number(5):=1;
    procedure fibo(n number)
    as
    begin
    next:=first+second;
    first:=second;
    second:=next;
    dbms_output.put_line(next);
    end;

    begin
    dbms_output.put_line('Enter the number of terms:');
    n:=&n;
    for i in 0..n loop
    if i<=1 then
    dbms_output.put_line(i);
    else
    fibo(i);
    end if;
    end loop;
    end;
    /


    ReplyDelete
  9. ID : 201620195
    https://www.dropbox.com/s/1h87wogjlqsf8rr/01.sql?dl=0

    ReplyDelete
  10. Md. Aminul Islam Tushar
    ID#201710063

    Link : https://drive.google.com/open?id=1urjZeUVbtTy653Kj9dfq-3sgUf5msl7h

    ReplyDelete
  11. Name: Yeasmin Sultana
    ID#201710251
    Link: https://drive.google.com/open?id=1snEewMG_D-SfK6ZqUbNvcyZM_QhZBJyO

    ReplyDelete
  12. Name:Sumsunnahar Nawa
    ID:201710090
    https://drive.google.com/open?id=16EqVSDOItAyhjjLaqZGn8SGf2PM7bWKQ

    ReplyDelete
  13. Md Rakibul Hasan
    201720620
    https://www.dropbox.com/s/p1k3zf2q8xjrwsn/hw2q1.pdf?dl=0

    ReplyDelete
  14. ID: 201710404
    https://drive.google.com/open?id=14eZf-DtdlD9fgbRmqnEeKO2kd8wCWlgb

    ReplyDelete
  15. abdul muzid sunny
    id: 201720450
    https://drive.google.com/open?id=1dF9FAaKfy2VK8K8VICJi8hIeJUr0xXHG

    ReplyDelete
  16. id: 201710081
    name : Eusha Chowdhury
    https://drive.google.com/open?id=19jGMhk8fFFhivqe0c0QDXSiJeMTTnkqd

    ReplyDelete
  17. Nusrat sumaya
    ID:201710950
    https://drive.google.com/file/d/1lcmyERuDmEbIPa5WRvkH00EJPFV9zk2x/view?usp=drivesdk

    ReplyDelete
  18. Fibonacci with user define function PLSQL
    https://drive.google.com/open?id=102Vk7f8a5O42ZCNJtDeIckGEZjR6u6Iu

    ReplyDelete
  19. https://drive.google.com/open?id=1CFifSicSFznh5ViWJzvETw3hFLFVLFMv

    ReplyDelete
  20. ID:201710750
    IBRAHIM QUAYUM
    https://drive.google.com/open?id=1dDnz7ACL_nvNmXs1DwESHCuke72Dcfv3

    ReplyDelete

Popular Posts