STARTING WITH POSTGRESQL AND VALENTINA STUDIO THROUGH CLI
Tags: sql, tutorial, writing, postgres
Published: 2022-05-25 12:48:08

## **POSTGRESQL is a Database Managing System DBMS while VALENTINA is a multi data-management-tool.**
After complete and proper installation of PostgreSQL on https://www.postgresql.org/download/ and valentina Studio on https://www.valentina-db.com/en/all-downloads/current, I have a database to work on.
![A picture of my available database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kwg2p3m3kx2jw1t7grck.png)
Extracting the zip file into a folder you have the following files:
![Content of the extracted folder right here](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jot7832qsdgu589oxn7g.png)
Next, databases are created for each file to work on Valentino Studio. First I create an Employee database for the employees SQL source file in  the extracted folder. This is done by clicking "create database" on valentina and titling it accordingly, in my case "Employee".
![A view of the "create database" on valentina](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5mh7dg2jvie4aygphh1c.png)
Click on create
![the pop up page for create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9w8ryydxnbb3gsmytep.png)
Next is to upload our 'employees' sql source present in our extracted database file to the created 'Employee' database on our valentina studio through the Command Line Interface CLI. You can easily reach your command line on windows pressing 'cmd' on your search. This is highlighted below:
Step1: Locate the directory of the sql source file in my case 'employee' from the extracted folder. Copy the directory, 
![View of my directory being copied](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv8f4vbbmahmhxsq5fe9.png)
 
go to the CLI and press 'cd' meaning 'changing directory' then paste the copied directory,
![Changing directory of my command line](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pnhnh0md7t7likx998t.png)
 tap enter and you have this:
![View of my command line in the employee folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzah95kesanlukw8cos8.png)
Step2: Locate your 'psql' file in your program files on your 'pgAdmin4' folder and copy the directory 
![View of my directory being copied](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szge05745c8nn6hhebk5.png)
 add psql.exe while having all the code in quote
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sd17ithhzq3gb3vicph.png)
'add -U postgres -d Employee<employees.sql' to upload the employees.sql to the pgAdmin4 and the -d to upload to the database on valentina. You have something of this nature:
![View of how the code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bq1x903px37gv9do4zfo.png)
tap enter and it demands for your postgres password 
![Inputting your password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/edivp3pn8xtl6k9moqg9.png)
You input your password and schema is created in the Employee folder in your database. A Schema is what contains tables and the details in your valentino.

We can now return to our valentina click on the public to see the tables present in our uploaded database.
![Schema in our valentina studio showing us the tables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8w09jponq2tigqlysj1.png)

To query your database, you click on the sql employee beside the Schema editor and the codes can be executed.
![Using the Schema editor for query](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zw2t0djjxrapu5aw0z71.png)