Understanding Division & Division by Zero

This is a quick review, which will lead up to addressing Division by Zero errors in SQL Server.

dividend ÷ divisor = quotient

Division is a way of splitting objects into equal groups.

Example 1)

12/3 = ? Can read analogous to:
Distribute 12 items into trays that can hold up to 3 items per tray.Empty Tray that can hold 3 items
How many trays will be completely filledTray filled completely with 3 items ?   = 4 full trays

Example 2)

12/12 = 1    Distribute 12 items into trays that can hold 12 items at a time.

12/6 = 2

12/4 =3

12/3 = 4

12/1 = 12

12/0 = ? looking at the pattern as the divisor decreases the quotient increases. This would imply a value greater than 12  but we only have 12 items to begin with for distribution.

This also implies distributing 12 items into trays that has no place holder to hold any items , the tray is completely flat.

So does this mean we can simply express it as a Remainder value ?

This can not even be expressed in the form of a remainder. Remainder are expressed in relation to the divisor as shown in the following example:

14/3 = 4 full trays +    = 4 + 2/3  which is mathematically equivalent to 12/3 + 2/3 = (12+2)/3 = 14/3

So the revised  formula is:

Dividend ÷ Divisor = Quotient + Remainder/Divisor      (where Divisor <> 0 )

Conclusion: 

Division by Zero is like a “Black Hole”, it is accounted for in all calculators and will generate an error.

I will show you how to handle Division By Zero T-SQL Queries in the next blog post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s