Day 2 - Let’s import and Browse a Sample Database

Hello everyone!

Before reading this article, please read the previous article of this series:

Welcome to the learning series of PostgreSQL. Today, we will load a sample database into our PostgreSQL DB and view the loaded columns. Let’s go!

Open the SQLectron desktop application.

Pressing Ctrl+O will open a new query, and we can load the sample .sql file. Alternatively, we can click on File à Open New Query.

Learn SQL

Click on Execute to load the tables into our database.

Create table in SQL

Right-click on postgres on the left-hand side to refresh the database, and you can view the tables under public.

We will also execute a command select * from students.

  • The command effectively selects all the columns from the student's table, as shown below.
  • This confirms that our sample data was successfully imported.

Refresh database

We could also select only the required columns (in this case, first_name, last_name, and course_name) as shown below:

Execute

That's it for today and in the next section, we will understand the data types and explore SQL queries to retrieve the data using various operators. Happy learning!

The next article of the series: