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))

```
The reason it goes into memory is because the runtime keeps track of a context stack into which is stores the local variables. A new context is added to the stack every time you enter a method (technically in Java-like languages, every time it encounters a '{'

So, basically if you wanted this to work, you want no context tracking. Assembler seems like a very good candidate. But it comes with it's own problems.

Better yet, why would you ever want to so something like that... You might want to reevaluate what you are doing...