Category: PostgreSQL

PostgreSQL Create Function

In PostgreSQL, the CREATE FUNCTION statement is used to create user-defined functions. Functions in PostgreSQL allow you to encapsulate a set of SQL statements and logic into a single reusable unit, which can be called from other SQL queries or used...

PostgreSQL View

PostgreSQL View The PostgreSQL commands: – CREATE VIEW is used to create a view. – ALTER VIEW is used to change view name. – DROP VIEW is used to delete a view. View syntax -- create view CREATE [OR REPLACE] VIEW...

PostgreSQL SUM

PostgreSQL SUM The PostgreSQL SUM aggregate function returns the sum value of all rows in a select. SUM syntax SELECT SUM(table_column) FROM table_name; SUM example Goods table id good_type name description price 1 A Car_1 Car 1 description 100 2 A...

PostgreSQL MIN

PostgreSQL MIN The PostgreSQL MIN aggregate function returns the minimum value in a select. MIN syntax SELECT MIN(table_column) FROM table_name; MIN example Goods table id good_type name description price 1 A Car_1 Car 1 description 100 2 A Car_2 Car 2...

PostgreSQL MAX

PostgreSQL MAX The PostgreSQL MAX aggregate function returns the maximum value in a select. MAX syntax SELECT MAX(table_column) FROM table_name; MAX example Goods table id good_type name description price 1 A Car_1 Car 1 description 100 2 A Car_2 Car 2...