Group By in PostgreSQL

Group By in PostgreSQL with More Than One Column

In this PostgreSQL tutorial, I will show you how to use GROUP BY in PostgreSQL with syntax. Also, you will understand how to use the GROUP BY clause with aggregate functions such as count(), sum() and etc. Additionally, I will show you how to use the GROUP BY clause with multiple columns and the JOIN … Read more >>

How to Use Postgresql Having Clause

Postgresql Having Clause with Count()

In this PostgreSQL tutorial, I will show you how to use PostgreSQL Having clause where you will learn how to filter the aggregated result using the HAVING clause based on the given condition. Additionally, I will show how to use different aggregate functions such as count(), sum(), min(), and max() along with the HAVING clause. … Read more >>

How to Delete Row in PostgreSQL

How to Delete Multiple Rows in PostgreSQL

In this PostgreSQL tutorial, I will teach you how to delete row in PostgreSQL. Also, you will learn about deleting a single row or multiple rows from the table. Then at the end, I will show you how to return the deleted rows from the table and also how to delete all the rows from … Read more >>

PostgreSQL CASE Multiple Columns

PostgreSQL CASE Multiple Columns Simple CASE

In this PostgreSQL tutorial, we will learn about PostgreSQL CASE Multiple Columns with different examples such as using the simple and searched CASE. What are PostgreSQL CASE Multiple Columns? Similar to IF-THEN-ELSE statements in other programming languages, the CASE statement in PostgreSQL expresses a condition. It allows us to conditional login in SQL queries, which … Read more >>

PostgreSQL Insert Into Table Select * From Another Table

PostgreSQL Insert into Table Select from Another Table

In this PostgreSQL tutorial, we will know how PostgreSQL Insert Into Table Select * From Another Table with syntax and examples. PostgreSQL Insert Into Table Select * From Another Table Consider a situation where you need to insert the data from one table to another table, “What will you do?”. You will use the statement … Read more >>

PostgreSQL Date Part Hour

PostgreSQL Date Part Hour with CURRENT_TIMESTAMP

In this PostgreSQL tutorial, we will discuss PostgreSQL Date Part Hour to get the hour value from the timestamp. Here we will use the function date_part() to extract the hour component with different examples such as from the current timestamp, interval, and table. What is PostgreSQL Date Part Hour The date_part() function in PostgreSQL returns … Read more >>

How to Create Database in PostgreSQL

How to Create Database in PostgreSQL Using Verifying Database

In this PostgreSQL tutorial, we will learn about How to Create a Database in PostgreSQL using two methods, using the terminal and the Graphical User Interface (GUI) called pgAdmin. How to Create Database in PostgreSQL Using Terminal Before beginning to create a database, make sure that you have already installed PostgreSQL on your computer. To … Read more >>

PostgreSQL installation on Linux step by step

PostgreSQL Installation on Linux Install PostgreSQL

In this PostgreSQL tutorial, we will learn about “PostgreSQL Installation on Linux” with how to solve the error when installing PostgreSQL. Additionally, we will delve into the steps to create a new user, and database, and grant privileges within PostgreSQL. Step 1: Update the System Packages Before installing any new software, it’s essential to update … Read more >>

Postgresql unique constraint

Postgresql unique constraint

In this PostgreSQL tutorial, we will learn about “Postgresql unique” and cover the following topics. Postgresql unique constraint In Postgresql, we want to ensure that values stored in a column or a group of columns are unique across the whole table such as email addresses or usernames. PostgreSQL provides us with the UNIQUE constraint that keeps … Read more >>

PostgreSQL Subquery with Examples

PostgreSQL Subquery

In this PostgreSQL tutorial, we will study the usage of the PostgreSQL subquery that will allow us to create queries within the query. And we are going to discuss the following list of topics. PostgreSQL subquery In PostgreSQL, A query is a question or a request for information expressed. A subquery is a query within … Read more >>