SQL for Beginner Data Scientist

Let’s move to SQL and have some fun with it typing these SQL expressions:CREATE TABLE test_table(name TEXT, phone VARCHAR(11), address TEXT);INSERT INTO test_table VALUES ('Zaid', '07911123456','Oxford Street');INSERT INTO test_table VALUES ('David', '07922123456','Manchester Street');The first line generates a new table called “test_table ” The second and the third insert some values in the table.

SELECT * FROM test_table;The line above prints all the values to the screen from the test_tableAfter this little game with SQL you exit from PostgreSQL Console again:postgres=# qStep Three: Installation of pgAdminIt is time to install and set up pgAdmin.

pgAdmin is an open-source administration and development platform for PostgreSQL and its related database management systems.

Written in Python and jQuery, it supports all the features found in PostgreSQL.

You can use pgAdmin to do everything from connecting to your In this step you have to do three tasks to accomplish the first step of your missionPostgres database from your personal laptop, writing basic SQL queries, writing complex queries, monitoring your databases and configuring advanced database architectures.

In this tutorial, we’ll walk through the process of installing and configuring the latest version of pgAdmin, accessing pgAdmin through a web browser, and connecting it to a PostgreSQL database on your server.

In this step, you have to do three tasks to accomplish the third step of your mission.

First Task: Configuration of the connections.

As a first task, make your remote server ready to connect by typing these pieces of code.

The first line is to allow incoming connection from any (or specific) IP addresses.

$ sudo su – root# echo "listen_addresses = '*'" >> /etc/postgresql/10/main/postgresql.

confNote: the line above is only one line, be careful with this.

The second line is for enabling the applicable user to access all databases from any (or specific) IP addresses.

# echo 'host all all 0.

0.

0.

0/0 md5' >> etc/postgresql/10/main/pg_hba.

confNote: this is one line of code!.Only your browser breaks it into 2 lines!After you added these two lines, then you restart and exit from root bash.

# /etc/init.

d/postgresql restart# exitSecond Task: Download and install the program.

Import the repository key from https://www.

postgresql.

org/media/keys/ACCC4CF8.

asc:$ sudo apt-get install curl ca-certificates curl https://www.

postgresql.

org/media/keys/ACCC4CF8.

asc | sudo apt-key add -(You may determine the codename of your distribution by running lsb_release -c).

For a shorthand version of the above, presuming you are using a supported release:$ sudo sh -c 'echo "deb http://apt.

postgresql.

org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.

list.

d/pgdg.

list'Finally, update the package lists, and start installing packages:$ sudo apt-get update sudo apt-get install pgadmin4Third Task: Connecting with the server.

Once you are done, you will see this screen:Click the Add New Server Icon and fill in the pop up:GENERAL:“Name:” anything you want (eg.

“our test server“)“CONNECTION:”“Host name/address:” your remote server’s IP Address (in my case: 46.

101.

128.

118)“Port:” 5432“Maintenance database:” postgres“User name:” [your_user_name]“Password:” your recently generated SQL password for your userClick and save Congratulations!!.You are connected to your database!At first sight, it’s not really straightforward, but you can discover the different folders on the left side.

If you right click on the name of the server (on my screenshot: “SafaCreations Test Server”), you can disconnect from your server.

Or connect the same way, when you want to get back.

Notice that on our screenshot you can see the very same result that we got in the PostgreSQL Console!CONCLUSIONYou accomplish the mission my dear friend Well Done!You have created you have installed SQL This is a fantastic first step for you towards becoming a Data Scientist!As I have mentioned a number of times during this article, I have been creating quite a few tutorials to show you how to use SQL.

All of these start from the very basics.

We will start to put more articles in the next weeks.

So keep in touch with us, and discover an easy way to learn SQL.

Thanks for reading.

If you loved this article, feel free to hit that follow button so we can stay in touch.

Originally published at https://www.

safacreations.

net.

.. More details

Leave a Reply