Importing SQL Database to PostgreSQL and Valentina Studio using command line
Published: 2022-05-25 13:33:48

Let us begin by defining what Valentina studio is and what it is used for

**Valentina Studio** is a multi data management tool that helps to create, administer, query, and explore databases.

It works with different DBMS(Data Base Management System), for example Postgres, MySQL, ODBC, MongoDB e.t.c.

**What is PgAdmin?**

**PgAdmin** is a web-based GUI tool used to interact with the Postgres database sessions, both locally and remote servers as well. 
You can use PgAdmin to perform any sort of database administration required for a Postgres database.

**What is PostgreSQL?**

**PostgreSQL** is one of the most advanced open source relational database system. It is characterized by many features that help developers build applications, administrators to protect data integrity and help data analyst and data scientist to manage their data regardless of the size of the dataset.




**STEP 1**
Connect your Valentina studio to your PgAdmin 

see screenshot below.

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


 

**STEP 2**
Call up command line using (windows + R)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/deycwy4707d8ke6hc4su.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h3zz1irqe5qw06yqnuq4.png)
 
 
**STEP 3**
Locate where you have your database on your computer then change directory to that file location.

see screenshot below
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcec78jbn2qhk5jae7a5.png)
 **C:\Users\EvansEnosegbe>cd downloads
Note: cd means change directory**

**STEP 4**
Locate the exact file inside the download folder
C:\Users\EvansEnosegbe\Downloads>cd databases

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



**STEP 5**
Now the next thing to do is to load the located database to PostgreSQL and Valentina studio.
To do this, open your Valentina studio and create the database you are about to load.

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

**STEP 6**
1 The first database I want to load is the employee database.
see command line and result below.

C:\Users\EvansEnosegbe\Downloads\databases\employee>"C:\Program Files\PostgreSQL\14\bin\psql.exe" -U postgres -d Employee < employees.sql

Once you click on enter, it will ask for your password, please enter your PostgreSQL password then press the enter key. 

**Note: "C:\Program Files\PostgreSQL\14\bin\psql.exe" was included to make it an operable program, it was gotten from program file.**

**See screenshot below**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6708091ozr52qv9803oi.png)
 



**U**  Means specify user
**d** Means database created
**<**Means loading a backup file into the database I have created
 

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

2. Second database I want to load is the France database.
This has been created on Valentina studio also

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

see command and result below.

C:\Users\EvansEnosegbe\Downloads\databases>"C:\Program Files\PostgreSQL\14\bin\psql.exe" -U postgres -d France <france.sql




See command line and result below.

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




**Thanks for checking this out.**