Join Bill Weinman for an in-depth discussion in this video Storing floating-point numbers with REAL, part of PostgreSQL 9 with PHP Essential Training.
Postgres provides two sizes of floating- point storage: REAL and DOUBLE PRECISION.…So here we have a table with a REAL type and a DOUBLE PRECISION type, and we're…inserting these same values we've been using throughout this chapter.…So let's go ahead and take a look at the results.…There we see we're successfully storing all four rows of numbers, and if you…look at these last couple of rows, you'll see that the way they're being…displayed is with not necessarily all of the significant digits, but with the…scientific notation e, +, and the number of positions to the right where the…decimal point would move.…
So what this means is that floating-point numbers are stored with a larger…scale, that is, a larger magnitude, but a lower amount of precision.…In other words, there are only so many significant digits where they're…guaranteed to be accurate.…So let's take look at another example that will illuminate this effect.…I'm going to create this table all over again.…And in this case, we're going to use two numeric columns and two real, or…
- Installing PostgreSQL
- Understanding database architecture
- Inserting, updating, and deleting data in a table
- Creating a database library
- Indexing ID fields
- Storing numbers, text, and Boolean values
- Reading data
- Using casts to force type
- Using mathematical functions
- Concatenating strings
- Working with date and time functions and operators
- Defining CRUD
- Using PHP to insert, read, update, and delete rows in a database
Skill Level Beginner
1. Quick Start
2. Creating a Database
3. Data Types
4. Storing and Reading Data
5. SQL Expressions
6. Mathematical Functions and Operators
Using math functions3m 2s
7. String Functions and Operators
8. Date and Time Functions and Operators
9. PHP Interfaces
10. Web Applications
- 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.