All right, so here we are on Ubuntu and we're inside of Valentinos studio, so now we want to set up
our environment to import our databases because throughout the course we will be utilizing the databases
that we put together for you for all of the exercises.
So let's go in here and let's create some of the databases.
So first, the database we want to create is employees create.
Then the second database we want to create is called store.
So we're setting all of these up, all of these databases that we're going to be basically recovering
from a backup.
And so after store, we'll do France and after France, we will do a world.
So we have all of these databases that have certain data in them.
And now we have to go ahead and we have to restore them.
So we have to run a command.
And as part of what we've given you is Eskew scripts that you can run on your system to restore from
a backup.
And so over here, you can see on my desktop I have this folder databases and what databases contains
is all of the databases that we need to restore.
So you can see here I have an employee folder that has all of these employee Ezekial scripts.
I have the transcript, I have store script and I have the world script.
So now we have to start restoring the backup.
So how are we going to do this?
Well, for one thing, we need to restore the backup from where it came.
So we need to be in the employee folder because this is the biggest database we have.
I've gone ahead and I've changed my directory to desktop databases, employee.
And if you need to do this, you can just use the CD command and start from the desktop and go forward
until you make it to employee.
And then once you're in the employee folder, what you want to do is you want to restore the database
that you previously had.
So we're going to run the command and we're going to do minus you, PostgreSQL, when we do minus H
for localhost.
And then what we're going to do is we're going to target the database employees that we just meet and
we're going to say run the employee script inside of there and then we're going to fill in the password.
And as you can see, I already ran part of the script, so I got some errors.
But now it's inserting all of the data.
So it's loading the department data, the employee data.
And this may take a while because this is a fairly large database that we have right here.
But once this is done, you're good to go.
You're golden.
And you may be asking yourself, OK, why do I have to be in this folder?
Well, the reason is because all of these scripts are pointing to the exact place where the scripts
are.
So you need to be in that same folder when running it for employees.
Specifically, all the other databases that will be restoring are going to be fairly simpler.
They're also going to be fairly smaller.
But we want to give you one big hearty database that you could work off of and that you could use to
run multiple types of queries on.
And it is the database that we will be using the most.
But we want to give you a variety of options just in case you wanted to try something out on different
types of data and kind of go explore.
It's nice to have that option there.
And so once this is done and it could take a varying amount of time for each of your systems, you're
good to go.
So what we want to do next is we want to go back into databases.
So I thought that and now we can see here that we have all of these other databases, so let's go ahead
and let's restore those.
So let's open up our command here and now let's target a different database.
Let's target world.
And let's say you're going to load world data school and then route.
Boom, you're done.
See, I told you they would go faster, then we're going to target France and we're going to say France
thought school.
Boom, done, and now for the final database, we're going to Target store and we're going to say store
Lauriski will.
And then we're going to finish with Root and there you go.
You're good to go.
So let's open Valentina's studio again and let's see what's in there.
So I still haven't verified my registration.
You should definitely do this.
So let's fill in our password route and then we can see here now that if we open up the database and
we open up the public scheme, we have all of our data.
So let's go and look.
Oh, there's a bunch of data in here.
And the same for France.
Let's open it up.
Let's go into public departments and regions, store categories, products, reorder world.
City, country, country language, so we have all of our data available and we're ready to hit the
ground running, we are ready to write queries like a madman.
So let's get into it.