So today, this happened:
Now I suddenly want to know how many bananas tall I am… https://t.co/7geupBzXDj
— MidnightDBA (@MidnightDBA) September 6, 2018
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.
Can this be extended to other fruits such as plantains? What about durians?
I think the applications are multitudinous.
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…
You’re welcome. 🙂