The results of integer division may not always be what you expect. Explore some examples, including remainders and modulus.
- [Instructor] When performing division operations…on integer values, the results will always be integers…and the results may not always be what you expect.…For example if I say select one divided by two…and press go the answer is zero.…And this may not be what you expect.…One way to deal with this would be…to convert one of these values to a real number…by putting in a .0 like this,…and now I get a .5 result, but that's not an integer.…
.5 is not an integer, it is a real number.…I can get the same result by taking that one integer…and casting it using the Cast function.…One as real, like this.…And again, I will get the .5 but the .5 is not an integer.…Both of these solutions have the same problem.…Division of real numbers is not integer division…so the answer is not an integer.…For example if we take 17 divided by five and I press go,…the answer is three but we know that there is a remainder.…
So I can get the remainder by using the modulus operator.…17 modulus five…and when I press go, now I know…that 17 divided by five is three with a remainder of two.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.