I’ll wait for those who want to go to take your leave… Go ahead… It's okay, I won't take it personally.
I'll wait…
Okay, for those of you who are left, let’s say that you have a business selling Pizza Baking Pans, and therefore you have a table with a Description, the Diameter (in inches), and the Height (in inches) of the pan:
create table #PizzaBakingPansAnd let’s say your customers want to know the volume (in cubic inches) of these assorted pans.
(
ID int identity(1,1) primary key
,Description varchar(20)
,Diameter numeric(4,2)
,Height numeric(4,2)
)
insert #PizzaBakingPans
select 'Traditional Personal', 8.0,0.5
union all select 'Traditional Small' ,10.0,0.5
union all select 'Traditional Medium' ,14.0,0.5
union all select 'Traditional Large' ,18.0,0.5
union all select 'Deep-Dish Small' ,10.0,3.5
union all select 'Deep-Dish Medium' ,14.0,3.5
union all select 'Deep-Dish Large' ,18.0,3.5
Well, you may recall from your high school geometry class that the volume of a cylindrical object is defined as V = πr²h. So, with that in mind, you create the following SQL query:
select DescriptionSee? I told you I was going to be frivolous and tongue-in-cheek. Don’t say I didn’t warn you.
,Volume=PI()*Z*Z*A
from #PizzaBakingPans
cross apply (select Z=Diameter/2
,A=Height) F
Even though it’s a key ingredient of pi*z*z*a, please refrain from throwing tomatoes at your screen. It's not my fault anyway. You can blame it on my daughter… she's the one who e-mailed me this joke.
Next time I promise I’ll have the usual challenging and mind-blowing content.

Why do the cross apply? I'd just use the POWER() function:
ReplyDeleteselect Description, PI()*POWER((Diameter/2),2)*Height
from #PizzaBakingPans
That daughter of yours sounds pretty weird! ;) haha and to the dude above me...I don't really know a lot about comp sci but I think the reason he didn't use the "easier" way was so he could make that AWESOME joke about pi*z*z*a...because it spells "pizza"...get it? Dude he said he was being frivolous...hop on the fun bus!
ReplyDelete@Lindsay: Yeah, the word "weird" doesn't even begin to describe my daughter. Wink-wink. Thanks for setting Jon straight.
ReplyDelete@Jonathan: See Lindsay's message.
I missed the PI*Z*Z*A part in the solution. I get the joke now. I knew I should have left the room.....
ReplyDelete@Jonathan: Believe me, I've done the same thing a million times. Sorry about Lindsay being so blunt... I have to teach her some restraint.
ReplyDeleteGreat insights shared here! I totally agree that choosing the right backlink opportunities can make a big difference in SEO results. By the way, for anyone interested in trading, I found this very useful resource on Best forex prop firm that might help in growing knowledge and practical experience. Thanks again for such a helpful post!
ReplyDeleteExcellent breakdown of trading psychology concepts. At FundedFirm, we’ve seen that the most successful traders think in probabilities rather than emotional reactions — your post captures that perfectly
ReplyDeleteGreat and informative article on managing personal finances. Understanding budgeting and smart money habits is very important for long-term stability. For those interested in trading, you can also check out a 5k free funded account to start trading without risking personal capital.
ReplyDeleteBest Forex Trading Platforms in India
ReplyDeleteIndia has a number of reliable and user-friendly forex trading platforms that cater to both beginners and experienced traders. Some of the best platforms include Zerodha Kite, Upstox Pro, Angel One Angel Broking App, and ICICI Direct ICICIdirect. These platforms are known for their intuitive interfaces, advanced charting tools, real-time market data, fast execution, and robust security features. They enable traders to access major currency pairs, analyze trends, implement strategies, and manage risk effectively from both desktop and mobile devices. While choosing a forex trading platform in India, it’s important to consider factors like ease of use, fees, educational resources, customer support, and regulatory compliance to ensure a smooth and secure trading experience.
Contact us Address – 1st Floor, The Sotheby Building, Rodney Bay, Gros-Islet, SAINT Lucia P.O Box 838, Castries, Saint Lucia Phone no – +97144471894 Website – https://winprofx.com/