Question: I am making a mysql database for a restaurant.

I have a table called: `*tbl_contents*` which stores all the contents used in the preparation of different menu items.  

Now I have to maintain a table for all the expenditures. These expenditures can be "purchasing contents" or some regular expenditure like electricity bill or rent of the restaurant.

How do I store two kinds of expenditures in the same table? 

I have the table `tbl_fixed_expanditures` and `tbl_contents`.
If i buy something for the kitchen it is supposed to be stored in `tbl_contents` and if I have paid the electricity bill, it is saved in `tbl_fixed_expenditures`.

![enter image description here](https://i.stack.imgur.com/hw2sq.png)

Answer: 
Yes, a language with [tail call optimisation](https://en.wikipedia.org/wiki/Tail_call) will avoid the stack overflow problem in this case. For example, the following Scheme code would execute indefinitely when one of the following functions is called:

```
(define (fun1 args)
    (fun2 args))

(define (fun2 args)
    (fun1 args))

```
Infinite loop does not always result in a crash if it does not require additional memory for each iteration.

Infinite recursion does not always result in a crash, especially if it is a tail recursion and depending on the compiler/programming language.

"Scheme" supports tail recursion.