PostgreSQL – Dollar-Quoted String Constants
In PostgreSQL, the dollar-quoted string constants ($$) is used in user-defined functions and stored procedures....
read more
PostgreSQL – RANK Function
In PostgreSQL, the RANK() function is used to assign a rank to each row of the query result set within the specified partition. The rank of the first row within each partition is 1....
read more
PostgreSQL – SPLIT_PART Function
The PostgreSQL SPLIT_PART() function is used to split a string from a specific delimiter and these queries return the nth substring....
read more
PostgreSQL – LAG Function
In PostgreSQL, the LAG() function is used to access a row that comes exactly before the current row at a specific physical offset. The LAG() comes in handy while comparing the values of the current row with the previous row....
read more
PostgreSQL – NULLIF() Function
PostgreSQL has a NULLIF function to handle null values. The NULLIF function is one of the most common conditional expressions provided by PostgreSQL....
read more
PostgreSQL – DELETE USING
PostgreSQL has various techniques to delete duplicate rows. One of them is using the DELETE USING statement....
read more
PostgreSQL – Temporary Table
A temporary table, as the name implies, is a short-lived table that exists for the duration of a database session. PostgreSQL automatically drops the temporary tables at the end of a session or a transaction....
read more
PostgreSQL – CREATE TABLE
In PostgreSQL, the CREATE TABLE clause as the name suggests is used to create new tables....
read more
PostgreSQL – Size of a Table
In this article, we will look into the function that is used to get the size of the PostgreSQL database table. In this article, we will be using a sample database for reference which is described here and can be downloaded from here....
read more
PostgreSQL – BIGINT Integer Data Type
PostgreSQL allows a type of integer type namely BIGINT. It requires 8 bytes of storage size and can store integers in the range of -9, 223, 372, 036, 854, 775, 808 to +9, 223, 372, 036, 854, 775, 807. Using BIGINT type is not only consuming a lot of storage but also decreasing the performance of the database, therefore, you should have a good reason to use it. It comes in handy for storing data like the number of stars in a galaxy, the scientific constants, etc....
read more
PostgreSQL – SMALLINT Integer Data Type
PostgreSQL allows a type of integer type namely SMALLINT. It requires 2 bytes of storage size and can store integers in the range of -37, 767 to 32, 767. It comes in handy for storing data like the age of people, the number of pages in a book, etc....
read more
PostgreSQL – GROUP BY clause
The PostgreSQL GROUP BY clause is used to divide rows returned by SELECT statement into different groups. The speciality of GROUP BY clause is that one can use Functions like SUM() to calculate the sum of items or COUNT() to get the total number of items in the groups....
read more