Importing Database into PostgreSQL and Valentino through CMD
Tags: sql, beginners
Published: 2022-05-25 10:43:23

Starting my journey as a data analyst, the first obstacle i faced was importing the database for the learning process, and this article is the step by step documentation of how i successfully imported the database into Valentina Studio and PostgreSQL.

Before diving in, let me explain what PostgreSQl, Valentina Studio and CMD is.

**Valentina Studio** is a database management tool suite for working with databases including MySQL, PostgreSQL, Microsoft SQL Server, MariaDB, and SQLite. it can be used to connect to multiple databases at the same time. it is a multi-data management tool.

**PostgreSQL** is a database management system, it supports both relational and non-relational data types.

**CMD** is an accronymn for command prompt. The command prompt is a native application of the Windows operating system and gives the user an option to perform operations using commands.

Having explained what PostgreSQL, Valentina Studio and CMD are, 
The first thing i did to import the database was to create a database title on Valentina studio.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pv0m27qqjrc549ise9l9.png)
In the image above, i created a database on Valentina studio with the title relating to the database i want to import. 
There are 4 databases to be imported, which are;

1. Employee
2. France
3. World
4. Store

I created database titles for these databases that i want to import into Valentina studios. see image below
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zd8p3oomnmah2oz31x4.png)
 
Next, I launched the CMD through the windows key + R and typed cmd.
on the CMD, I tried locating the location of the downloaded database file to be imported but I got an error response in return due to my not specifying the location correctly. kindly find the image below
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywymf5rsoy0ener50ts6.png)
finally, I corrected the error and I successfully located the location of the database. find image below
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4phtp8b35jcr0g747j3h.png)
Next is to create a user on PostgreSQL with the postgresql.exe file using cmd and importing the database into the database title that was previously created on Valentina studios
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqqh5l2c6udjwblqdlyw.png)
in the image above, I encountered some errors and that was due to not typing the correct user name on postgres, which I eventually corrected and the database imported successfully. 

the images below shows the Valentina studios with the empty employee database, and the one with the imported employee database after the cmd execution.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryzh1ozsmr4l12ra9pjm.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfbogu4m0yxzb9v5yfyh.png)
 next is to import the last 3 databases which are France, World and Store, using the cmd.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9omsmpakrfwvu07cx7yh.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo1zacsu22k75orzz8iz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/783iljnsoppxey7jbtsc.png)
   
Upon successful importation of the database, the created database titles created on the Valentina studio had been populated with the database. find below the images.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3h89bwpanalwdhzxdjh.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdlc6d771t8theh0s8vj.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0newxama8zo3mewudrbj.png)
 

Having imported the database, automatically, the database gets imported to PostgreSQL too, and it can also be queried using the PgAdmin 4 software. find the below image

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzlru4tbns9um7l13e48.png)