My Learning Journey (PostgreSQL)

Rahime Yeşil
Data Runner
Published in
3 min readApr 29, 2022

PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness,and performance.Also it can be used on most operating systems including Linux, macOS, Windows etc.

When I decided to learn PostgreSQL, the first thing that I did was visit its website for downloading it.(click here to go) According to your operating system, you can download any version of it. After download it , I’ve texted postgre in search bar to find , but couldnt find it because of it has downloaded with its GUI tool that called PGAdmin. In order to manage the Postgres database and its services, PGAdmin is used.

To write a query click the button in browser tab after you connect your server.

Query Tool

First thing that I want to create a table , you can create a table with click the right side on tables section.

Table create in PostgreSQL

Also you can create a table by writing create script in query tool screen which we will use for most of our queries.

Create Statement in PostgreSQL

I also created an example table with write create statement like below :

In here I suggest you be careful about schema. If you dont determine your table’s schema while creating it , It will be in default public schema. Check there if you dont find your new table.

Lets add some records into table with INSERT INTO statement;

Lets see the records that we insert into the table with SELECT statement;

If you used any sql language like MSSQL , Oracle, MySQL etc before, you realize that their statements or syntaxes almost similar to each others. But some statements are completely different. I wish to mention about this kind of differences in this article .

If you used Mssql before there is no TOP or Oracle sql before you will see that there is no ROWNUM for filtering data.

I’m hearing the voices : what is equivalence of TOP in postgresql ? what is equivalence of ROWNUM in postgresql ? Answer is LIMIT. Even this table has not enough record to see functionality of LIMIT statement. Example:

As you see it show us to first record in the table.

Another something that I want to share with you is phrase completion in PGAdmin. Before I use this GUI , I’ve get used to feature of phrase completion of Microsoft SQL Server. Until I discover this feature in PGAdmin, it was diffucult times for me. Here is the solution ;

Press CTRL + Space in order to phrase completion in PostgreSQL,PGAdmin environment.

If you have any questions , feel free to contact with me!

--

--