PostgreSQL dml queries

postgresql dml

PostgreSQL DML (Data manipulation language ) statements to access and manipulate data in existing schema objects. These statements do not implicitly commit the current transaction. Some of the important data manipulation language statements are: A SELECT statement is a limited form of DML statement in that it can only access data in the database. It … Read more

PostgreSQL subquery

postgresql subquery

PostgreSQL subquery (also known as inner queries or nested queries) is a tool for performing operations in multiple steps. For example, if you wanted to take the sums of several columns, then average all of those values, you’d need to do each aggregation in a distinct step. PostgreSQL subquery Example: Subqueries can be used in … Read more

PostgreSQL Joins demystified

postgresql joins

In this tutorial, we learn about the complete join mechanism in PostgreSQL Joins. PostgreSQL joins are used to combine columns from one (self-join) or more tables based on the values of the common columns between the tables. The common columns are typically the primary key columns of the first table and foreign key columns of the second table. PostgreSQL joins … Read more

PostgreSQL union | PostgreSQL union all | PostgreSQL intersect

postgresql union clause

PostgreSQL: using Set Operators: Postgresql UNION Set operators combine the results of two component queries into a single result. Queries containing set operators are called compound queries. set operators include PostgreSQL union, PostgreSQL intersect etc., There are four types of set operators, they are Operator                      Returns … Read more

Grouping: Postgresql group by | PostgreSQL Having

postgresql group by clause

Grouping data is one of the most important tasks in SQL. The PostgreSQL GROUP BY Statement in SQL is used to arrange identical data into groups with the help of the group functions. i.e if a particular column has the same values in different rows then it will arrange these rows in a group. PostgreSQL group … Read more

PostgreSQL order by clause

postgresql order by

In this post, we are going to learn how to sort the result set returned from the SELECTstatement by using the PostgreSQL ORDER BY clause. PostgreSQL Order by clause: If you want to sort the rows by some kind of attribute, you can use the SQL ORDER BY keyword. The ORDER BY keyword is used to sort the results in … Read more

Logical Operators: PostgreSQL AND, OR and NOT

postgresql and postgresql or not

In the previous post, we learned about how we restrict the results using where clause, now we will learn more about sql where clause with logical operators in SQL. The three important logical operators are PostgreSQL and, or and not. Also read, PostgreSQL where clause Logical Operators: PostgreSQL A logical condition combines the two-component conditions … Read more

PostgreSQL Where clause : Part 2

postgresql where clause

In the previous post we learned about PostgreSQL where clause introduction, In this post, we learn more about restricting the rows using different types of using where clause in postgreSQL with examples. when retrieving data from the database, you may need to do the following. 1. restrict the rows of data that are displayed. 2. specify the order … Read more

PostgreSQL Select : Different Ways To Retrieve Data Using Select Statement

postgresql select

In this post, we are going to learn about PostgreSQL Select statement. A SQL select statement retrieves information from the database. With a SELECT statement, you can use the following capabilities. Projection: Select the columns in a table that are returned by a query. select as few or as many of the columns required. Selection:  Select the rows in a … Read more