In PostgreSQL, the AVG() function computes the average (arithmetic mean) of all the non-null input values, and returns the result.
PostgreSQL
PostgreSQL DESCRIBE TABLE Equivalent
Some DBMSs such as Oracle, MySQL, and MariaDB have a DESCRIBE command that returns information about tables and views. It goes DESCRIBE table where table is the name of the table or view, and it can also be followed by a column name if you only want information about a specific column.
PostgreSQL doesn’t have a DESCRIBE TABLE command as such, but there are alternatives.
3 Ways to List All Functions in PostgreSQL
Here are three options for listing out all functions in a PostgreSQL database.
3 Ways to Check a Column’s Data Type in PostgreSQL
Here are three ways to get the data type of a given column in MariaDB.
MAX() Function in PostgreSQL
In PostgreSQL, the MAX() function computes the maximum of the non-null input values and returns the result.
This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.
MIN() Function in PostgreSQL
In PostgreSQL, the MIN() function computes the minimum of the non-null input values and returns the result.
This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.
How to Format Numbers with Commas in SQL
Most of the major RDBMSs have functions that enable us to format numbers with commas as either the group separator, or the decimal separator.
Some RDBMSs also output certain numeric data types with commas in the relevant place.
Below are examples of formatting numbers with commas in some of the more popular DBMSs.
3 Ways to List all Stored Procedures in a PostgreSQL Database
Here are three options for listing out all the stored procedures in a Postgres database.
How to Change the Locale When Formatting Numbers in PostgreSQL
If you’re formatting a number in PostgreSQL, and you want to change the locale so that the correct group and decimal separators are used, here’s how you can do that.