Introduction
In this article, you are going to learn about a database management system called PostgreSQL.
Now, PostgreSQL is by far one of the most popular databases out there.
The cool things which make PostgreSQL different are:
- It is open source
- It is robust
- It has a high performance
What is PostgreSQL?
PostgreSQL is an actual object-relational database management system. And it is the world’s most advanced open-source relation database.
PostgreSQL is accepted by many organizations because:
- It has over 30 years of active development
- It is a powerful, open-source object-relational database system.
- It has a strong reputation for reliability, robustness of functionality, and performance.
PostgreSQL has many sophisticated features provided by other enterprise-class database management systems, such as:
- Types that are user-defined
- Inheritance of the table
- Sophisticated mechanism of locking
- Referential honesty of the international main
- Views, regulations
- sub-queries
- Transactions Nested (savepoints)
- Regulation of multi-version concurrency (MVCC)
- Replication asynchronous
There are more features added in every minor release of PostgreSQL.
Companies using PostgreSQL
It is used by many Startups as well as many well-established companies for their backend application. Some companies are Apple, Red Hat, Cisco, Instagram, and many more.
So you as a software developer should be aware of this database, how to use it in projects, and most importantly for your career as a software developer.
This article will help you to learn PostgreSQL from scratch
So buckle up!!!
Language support
The most popular programming languages supporting PostgreSQL and vise-versa are:
- C/C++
- C#
- Java
- JavaScript(Node.js)
- Python
- Ruby
- Perl
- Go
- TCL
Common Use case Scenario of PostgreSQL
- Database of general-purpose transactions
In order to help their applications and products, large companies, and startups both use PostgreSQL as primary databases.
- A robust database
As a robust back-end database that drives several dynamic websites and mobile apps, PostgreSQL is mainly used.
What is a database?
A database can simply be said as a place where we can store, manipulate, and retrieve data.
So data are often stored in a computer server.
So basically use can store data you can see data you can manipulate data, retrieve, delete, update, and all of the actions provided by the actual database.
Now let’s go through some real-life examples where we can see the use of databases. I will be discussing Facebook as all of you know about it and use it on a daily basis.
Facebook
We all know Facebook, so Facebook is a place where we can connect with people all around the world. So Facebook stores a lot of information about us.
I will let you guys guess where they store all of our data.
YES!!! You are correct. They store all our data in the database.
The same thing happens with Amazon and many other companies.
Now let us move on to what does SQL means.
What is SQL?
SQL is an actual Structured Query Language. This structured query language allows us to work with databases.
In simple terms, it helps us to interact with the database.
SQL is a programming language that allows us to have a command like this
- SELECT first_name FROM person
Here SELECT is an actual command and then we need to specify a column name[first_name] then the reserved keyword for SQL[FROM] and then the actual table name[person]
SQL allows us to manage data held in a relational database and it is easy to learn (as you saw in the above example). But being easy doesn’t mean that you can do much with it in contrast it is very powerful and is very widely used all over the internet.
Now let move
Installation of PostgreSQL on your Windows PC
SO for getting PostgreSQL on your pc go to the link below and download it and follow the steps.
https://www.postgresql.org/download/
Select windows and then click on “download installer”.
After that, you will see multiple options for downloading PostgreSQL on your device as shown in the figure below.
Select the latest version as shown on your screen and download from windowsx86-64 for 64 bit.
After downloading go to the file where you downloaded PostgreSQL and open it.
Select the directory where you want to install PostgreSQL.
Now select all the checkboxes and click on next.
Now select the directory where you want to store your data.
Now you need to create a password for yourself (superuser).
Select the port number for the server.
Select the location as default and click next
It will take a few minutes to install.
Uncheck the stack builder option and click on finish. And you are ready to go.
Now that we have our database running we need a way to connect to it.
Remember that our computer is serving as a computer server i.e database server. So anyone can connect to it and view the content modify the content.
So the way to connect to the database server:
- GUI client
- Terminal/CMD
- Application
GUI client
- Now the very first way to connect to the database server is a GUI client and this is an application that eases the way you connect to the database. It makes life easy in terms of performing inserts, delete, view the data, and have like all these fancy UI elements that allow you to see your database in a much easy way.
- Let me give you a GUI client name so that you can have a brief idea about that.
Terminal/CMD
The second way is using the Terminal/Command line and this is my preferred choice and this is because this is how you get your hands dirty by learning all the commands that your database of choice required to manipulate your database and once you learn how to use Terminal or command line which is not difficult, to be honest than using a GUI client is very trigger.
Application
The third way is using an application, so for example you write a server-side application where you connect your database and can perform data manipulation, and then you can return the data to your client so the client can make the data look nice on the screen or a mobile application.
So as I said, learning Terminal or command line is not difficult at all. I will make sure in the next few articles to make it super easy for you and by the end of this tutorial you will be comfortable using terminal or command line.
Conclusion
In this article, you learned about PostgreSQL and how to install it on your Windows PC.