The results of integer division may not always be what you expect. Here are 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 divide, 1 / 2, … here is in the first one of these expressions here, … the result is zero, and you may not expect that result, … you may expect a result of .5. … Remember, these are integers and so the result … will be an integer and .5 is not an integer. … So you can put a .0 at the end of one of the two operands … and that will give you a result of .5, … but now you're no longer doing integer division, … your result is real number and in fact, … one of your operands is a real number. … You can get this same result by casting … one of the operands as real using the cast function … like this, and again same thing, your result … is a real number not an integer. … The solution to this problem is in the modulo operator, … for example, 17 / 5 … is not three, it's 3.4, … and so we're getting integer value of three, …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- 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
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. 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.