Check out example codes for "postgresql install ubuntu". It will help you in understanding the concepts better.

Code Example 1

sudo apt update
sudo apt install postgresql postgresql-contrib

sudo -u postgres createuser --interactive

sudo -u postgres createdb database1

Code Example 2

sudo apt install postgresql postgresql-contrib

Learn ReactJs, React Native from akashmittal.com