Join Bill Weinman for an in-depth discussion in this video Storing decimal numbers with NUMERIC, part of PostgreSQL 9 with PHP Essential Training.
Postgres provides a numeric type for storing fixed-precision numbers.…Here we have a table being created with two columns, and each of them is of the…numeric type, and we are inserting the same values that we have been using for…all of the fixed-precision and integer numbers throughout this chapter.…And we go ahead and select them from the table so we can see what they look like…and then drop the table. So we'll go ahead and press Go and you see that all of these…values were successfully inserted into the table and are all being read and…displaying properly.…
Now the point of numeric is actually to provide fixed precision.…So if I were to say, for example, 12, 2--and we will do the same thing over…for this other one--…what this does is is it provides space for twelve digits of precision, with the…decimal place two positions from the right.…So in other words, it will be ten digits of decimal place and two digits.…So this bottom number obviously is going to be too long.…Go ahead and select Go and sure enough, we see that "A field with precision 12,…
- 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
PHP with MySQL Beyond the Basicswith Kevin Skoglund10h 26m Intermediate
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?
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.