Join Bill Weinman for an in-depth discussion in this video Using operators for simple arithmetic, part of PostgreSQL 9 with PHP Essential Training.
Postgres provides a rich set of mathematical operators and functions as you can…see here on this Documentation page from the Postgres web site.…These are the mathematical operators that are available, and there is also a rich…set of mathematical functions, including all the common trigonometric…operations as well.…Let's take look at how we use some of these operators in practice.…So I'll bring up SID here and for example if you wanted to simply do simple…arithmetic, you can say something like SELECT 5*30;…and you get a result of 150 like it should be.…
If you want to do a simple division you can say something like SELECT 7/3 …and the answer is 2, because this is integer division.…Seven is an integer and three is an integer, and so it's going to give you an…integer division, which will ignore the remainder part.…If you use the modulus operator, which is the percent sign, that will give you…the remainder which is one.…So 7/3 is 2 with a remainder of one.…If you really want the floating-point division you can say 7.0/3; and this'll…
- 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.