PostgreSQL

PostgreSQL tutorial for Beginners – PostgreSQL – TRIGGERS

PostgreSQL – TRIGGERS   PostgreSQL Triggers are database callback functions, which are automatically performed/invoked when a specified database event occurs. The following are important points about PostgreSQL triggers − PostgreSQL trigger can be specified to fire Before the operation is attempted on a row (before constraints are checked and the INSERT, UPDATE or DELETE is attempted) After …

PostgreSQL tutorial for Beginners – PostgreSQL – UNIONS Clause

PostgreSQL – UNIONS Clause   The PostgreSQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows. To use UNION, each SELECT must have the same number of columns selected, the same number of column expressions, the same data type, and have them in the same order but …

PostgreSQL tutorial for Beginners – PostgreSQL – CONSTRAINTS

PostgreSQL – CONSTRAINTS   Constraints are the rules enforced on data columns on table. These are used to prevent invalid data from being entered into the database. This ensures the accuracy and reliability of the data in the database. Constraints could be column level or table level. Column level constraints are applied only to one …

PostgreSQL tutorial for Beginners – PostgreSQL – DISTINCT Keyword

PostgreSQL – DISTINCT Keyword   The PostgreSQL DISTINCT keyword is used in conjunction with SELECT statement to eliminate all the duplicate records and fetching only unique records. There may be a situation when you have multiple duplicate records in a table. While fetching such records, it makes more sense to fetch only unique records instead of fetching …

PostgreSQL tutorial for Beginners – PostgreSQL – HAVING Clause

PostgreSQL – HAVING Clause   The HAVING clause allows us to pick out particular rows where the function’s result meets some condition. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause. Syntax The following is the position of the HAVING clause …