PostgreSQL: Fibonacci Series Function for Database Developer Interview

In this post, I am sharing one user define function to generate Fibonacci Series in PostgreSQL.

Today Morning, I have started to take the interview for PostgreSQL Database Developer.

Generally, I am asking complex SQL Query, but this time I have asked to implement few mathematical logics like: “Write a small function to generate Fibonacci Series”.
Fibonacci Series means a series of numbers in which each number is the sum of the two preceding numbers.
e.g 1, 1, 2, 3, 5, 8, 13…

I am sharing this solution here, Database Developer should prepare yourself because Interviewer like, me can ask this kind of question.

Fibonacci Series Function:

Execute Function to generate Fibonacci Series upto 50:

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of