column1, column2, …: The columns in the table to insert values.expression1, expression2, …: These are the An expression or value to assign to the corresponding column.DEFAULT: All columns will be populated with their default values.

PostgreSQL SELECT

you are going to learn how to use PostgreSQL SELECT statement to query data from a table. PostgreSQL SELECT statement is used to fetch the data from a database table which returns data in the form of the result table. The basic syntax of simple SELECT statement is as follows.

Syntax

SELECT column1, column2, ...
FROM table_name;

column1, column2, …: columns in the table from which you want to query data.

To query data from all rows and all columns from the customer table, you use the following query:

Query

SELECT * FROM table_name;

Example:

Let’s take a look at an example using PostgreSQL SELECT statement to query the data from the payroll table.

Query

SELECT * FROM payroll;

Above query retrieve data from all rows and all columns from the payroll table.

Output

Following query retrieve all firstname and salary from the payroll table.

Anwar Yakkiparamban is the founder of Lauyou Learning. Prior to Lauyou learning, Anwar worked at ARD Engineering & Development, Qatar. He holds bachelor degree in Electronics and Communication Engineering from Govt. Engineering College Idukki.