I will call you back again to another lecture in PostgreSQL, and in this video we go ahead and learn
how to generate a large data set.
So over here we go ahead and generate a large data set.
Because right here you can see we have just four rows.
And I want to create something like 1000 rows.
I know you may be like okay no problem.
I'm going to take you on a simple step on how to do that.
Yes.
All right.
But it's going to be just a mockup.
Right.
So it's going to be just a mockup for this course.
Now let's go ahead and move over to our website.
And that website is called Mercado.
So Mercado is used by data analysts to experiment and play around.
And is going to be a very good introduction in this course.
So it's absolutely free.
As you know, it has appeared in case you want to generate more than 1000 data sets.
set, and that is when you're going to pay for it.
What if you're going to generate anything less than 1000 data sets?
So it's absolutely free.
Now we have some of the features name the ID, first name, last name, email gender IP address.
So these are by default right in here.
I want to remove the ID because we're going to auto increment.
And we don't need to improve that by ourselves.
And the first name is going to be there.
The last name will be there.
The email will be there.
Gender is something we've never used, but I think it's a very nice option.
We'll go ahead and leave the gender so that we can be able to use it so that every student is either
male or female.
All right.
So your male or your female.
So it's a very nice option.
We're going to leave that field.
But we don't need IP address.
Then we are going to include or exclude the email date.
So I'm going to put this in raw case.
So we're going to put in raw underscore dates.
And I'll go over to this and I'll go over to date dates and check out date.
Now we have what's called the.
Dates.
So if you check over here, we have a date.
And that is what I'm going to select.
And over here you we can select the year we want.
And let's go ahead and say maybe um.
We can start from any, any year we want or any time we want this to start from.
I can choose any one.
So I just want this to move to something ahead of me.
All right.
So that, uh, it's going to always look good.
So I'm going to start from 2030.
All right.
So from 2030, uh, I need to always select this first.
So I've changed to 2030.
And I can also change this to maybe 2050.
And, uh, this is just a mockup.
No problem.
And you're going to choose a date format.
I want the year to come first, then the month, and then do be.
That is what I want.
And I'm not going to leave anyone to be blunt.
So it's going to be 0% for black.
Then for the email address, we're going to make about 30 of them to be a blank, because I don't want
every student to have an email address that will be students that don't have email address.
No problem.
This is just for, uh, experiment.
Then I'm going to add maybe the country of the students.
Maybe the students are coming from different countries is an international school.
So go ahead and say country and I'll go over to date and I'm going to select country.
Go down here and let's select country.
And I'm not going to restrict any country.
It's just going to be the way they are.
I am going to go ahead and make this to be 2014 to 2015.
And the date format is the year, month and day.
And the email address 30% are going to be blank.
Why?
70% are going to be filled.
And I will learn here the rules are still going to be 1000 rows, because that is going to enable me
to download free.
And the format is going to be SQL.
So you can see you have a CSV, JSON and so on.
I'm going to select CSV.
Uh I want to select the SQL.
And then I'll go over here and change this to students.
And then I'm going to include the create table so that I can always work with this and make some adjustments.
And then I'll go ahead and hit on Create Data.
And once you click on Create Data it will download.
And you can see we have SQL here.
That is students SQL.
All right.
Now over here you can see we have a students table right in here.
And now I want to open up this.
I can use any editor or maybe Atom or Visual Studio or Sublime Text.
I'll go ahead and open the Visual Studio and this will have.
Then let's go ahead and move over to file and open this file.
And I'm going to double click on that.
And this is what I have now I have the first name, last name, email, gender, date and country.
And for the ID, which is a stress ID, I'm going to say, uh, stress underscore ID and this is going
to be the big Syria just like we always know.
So this is our big Syria.
And that is going to be not.
No.
And uh.
Primary key.
Now we go ahead and add not no to every other one.
So I'm going to copy this not no.
And I'm going to move under the first name.
And I'm going to say is not no.
And I'm going to go over here not no.
Then the email, I'm not going to include that because some of them to be blank and gender is not known.
Then the country and uh, I'll go ahead and leave the country to also be not known now.
Then for the dates, all I need to do is I'm going to go over to date and I'm going to say, not now.
I hope that is cool.
All right.
So now if I have done this, all I need to do is to go ahead and just save this.
Try to save your code.
All right.
And save this.
And I'm going to minimize this again.
Then I'll get right in here.
And I'm going to import this file.
So to import this file or had I use backward slash I.
So that is backward slash I and you then go ahead and copy the path.
So if I copy the path now I can be able to use that.
All right.
So if I go ahead and copy this part I'll go ahead and copy the parts of this.
And now that is copied out ahead and paste it in a notepad.
And it did it.
All right.
So I'll just copy the path.
And now all I have to do is use a memoir.
And then what I just did now is I change the forward slash, the backward slash to forward slash, because
that is the only way I can be able to use it.
And now I'm going to copy that and I'm get back to my SQL shell.
And I'm going to press this right in here so you can see backward slash I then everyone should be a
forward slash.
You remove the C that is in front and this is what is going to set.
Then you go ahead and hit enter.
Wow.
You can see that it is being loaded.
But there is an error which I'm seeing somewhere and we're going to address that error.
So if that is being put in and uh it's done, but there is an error, it says the column gender of variations
does not exist.
And uh, we can see we don't have any gender column.
Then what it means is that this table we have right in here has only first name, last name in row,
date, email and age and said, I'm going to drop this table.
All right, so if I drop this table, we go ahead and create a new table.
So I'll go right in here.
You can see below I still have option down here to create my table.
So what I need to do is first of all drop table.
And the table name is a student.
And I had to make that to be a lowercase students.
And I'll put a semicolon at the end and hit enter.
And you can see that the table is now dropped.
Now I'll go back and put my back.
Was I right in here.
And then I'm going to press that which I copied and the word head and hit enter.
And you can see that is being inserted and it has inserted everything.
Now if I want to see what I've just done, all I need to do is I can go over here or here.
And if I execute this, let's go ahead and check it out.
And you can see I have this because it looks good right in the end.
And I'm dragging this down, I'm dragging it up so that you can be able to see everything.
I hope you can see we have this file and that this is up to 1000 some correct clicking to the end of
this.
All right.
So you can see that is cool right now.
Let's go ahead and uh copy this okay I just copied them.
Go ahead and copy this.
So I will also check that on my SQL shell.
So I'm going to paste that right in here.
And I'm going to hit enter.
And uh I'm going to drag this open so that we can see everything.
Okay.
Let me go ahead and enlarge this.
And then it says this okay quiet I hit enter is going to open up every one of them 111 by one.
All right.
So the more you hit enter you can see I'm being I'm seeing everything and it's is going down.
So if you are using some of you, it might just open up all of them immediately.
But when you click on, more and more is going down and it's showing you all the tables that you have,
so I can be able to see everything, everything, everything.
So it's going down.
I'm checking out these and we are still on 700 and it's going down to 800 and it's moving down and very
soon it will get to 1000.
All right.
So we are almost there.
And now we have 1000 rows here.
So that is it.
Well you are able to create and uh generate a large data sets for this.
And that is very interesting.
So in the next video lecture go ahead and kick off and start again.
So thank you for getting to this point.
And that is a very big, big achievement.
See you in the next video lecture.