T-SQL: How many bananas tall are you?

So today, this happened:

And I realized it would be really easy to find that out, via a calculator, or – more amusingly – with SQL:

DECLARE @feet FLOAT = 5.0,
   @inches FLOAT = 5.0,
   @bananaIN FLOAT = 8.0; -- Small = 6, large = 8-9

SET @inches = @feet*12 + @inches;

SELECT @inches / @bananaIN as [IAmThisManyBananasTall];

So yeah. Code just for the fun of it.

4 thoughts on “T-SQL: How many bananas tall are you?

    1. Jen McCown Post author

      Okay but seriously, now you’ve got me thinking about creating a reference table with fruit lengths, changing the variables to fruits, and making the whole thing into a parameter used SP…

Comments are closed.