All righty.
So as I mentioned in the previous video, this section is a big turning point and hopefully you're excited
about it.
I'm excited to teach it.
We're going to go from what we've been doing for the last 12, 13 ish hours of content, basically working
with MySQL on its own, querying a database and getting a result printed back to us immediately, which
is great, but we're going to go from that to creating applications with my SQL.
We're not going to learn how to create complex video games or crazy iOS apps.
We're focusing mainly on web applications, but the ideas are the same.
I'm going to show you how you get an external language like JavaScript or PHP or Ruby to talk to my
SQL.
And we'll build a couple of things with that.
Now let's quickly review what we've done, not the entire course, but the way we've been working and
talk about the merits of that.
So we've been working with the CLI mainly, you know, having a database of users or books or whatever
it is and asking questions, you know, selecting sales data or orders data or customers and trying
to figure things out like how much did we sell last week?
Or What day of the week was our best selling day across the last two years?
Those are really important and valid and just common uses of my SQL.
So there is this whole subset of creating applications that we're diving into now, but there are tons
and tons of jobs, lots of people who, when they work with my SQL, all that they do.
Not to diminish it in any way because they can write some pretty complex queries, but they're working
with only my SQL and they're opening up the CLI, or they're writing SQL files like we've seen, and
they're just saving it and running those files.
So they want to see, okay, what was my commission that I made in the last year?
Calculating tax, whatever information, some summing a bunch of information in these tables or doing
a complex join to figure out which promotion work the best.
Those are really important and common uses that people do all the time.
So it's not just about building applications, but we've seen that first part.
We've seen how to do that.
We've worked with tables, we've been writing lots of selects, inserts, updates, deletes, all of
that.
Now we're going to see how we work with other languages.
So now it's time for my SQL plus any of these, pick one.
And the reason I'm even showing you this page is not to intimidate you, not to make you think.
You need to know all of these.
You only need one.
So depending on what you're doing, there are strengths and and disadvantages to certain languages.
But really, all of these will work.
They all have ways of communicating with my SQL.
So if you're someone who is comfortable with the language, like if you grew up working with Java or
you took a Python class in college or whatever it is, you can find ways.
I'll talk about what they are of connecting my SQL and whatever language you're comfortable with.
The one we're going to work with is called Node Node.
JS It's getting very, very popular.
It's been pretty popular for the last couple of years.
Very versatile language, lots and lots of users, great documentation out there.
Now we could have also gone with PHP.
Some of you may be wondering about that.
PHP and MySQL historically have been a bit of an item, a couple that were spotted together all the
time.
In the next video I will talk a bit about PHP.
It's totally optional, but I didn't want to bog you down in this video with it.
But there are a lot of opinions out there.
I'll give you a 10/2 preview.
A lot of people think PHP is dying.
It's certainly in decline compared to where it used to be.
It used to be the king of programming languages on the web.
Now there are lots of competitors and people are leaving PHP.
That doesn't mean that it's a bad language.
There are problems with it.
This is my opinion as well.
There are problems that other languages have been able to solve better.
However, there's a big user base out there.
Yes, it's not growing as fast every year, but there are still millions of people using it.
So do not shy away from PHP if you're comfortable with it, if you want to use it.
There's lots of examples out there, but I didn't want to make this course just another PHP in my SQL
course.
There are dozens.
They're getting dated, but there are dozens of them even on Udemy, lots of my SQL and PHP.
So I chose Node and I'll talk more about why in this optional video coming up.
Basically, JavaScript is the most popular programming language for the web right now and Node uses
JavaScript syntax and just generally Node is a great choice and I could have gone with any of these,
although I probably wouldn't have done any of the C languages, but Ruby or Python would have been equally
good choices.
However, I went with Node because honestly, that's what people want to learn right now and it's what
a lot of the jobs out there are for.
So that's all I'll say about that for now.
Like I said, any of these will work.
The next thing I want to talk about is how do they work?
What do they do?
So we pick a language, we're working with Node, but then what?
What's the point of using a program, a programming language?
How does it talk to my SQL through external code and what kinds of things would you do?
So here's a little diagram.
Imagine that there's a web application on my computer.
When I go to this hypothetical Amazon.com, I hit enter.
A request is made and I labeled this as Node.js.
Amazon does have some node in their stack, but this could be any language, so that doesn't matter.
But I send a request.
Hey Amazon, can you give me your home page or can you give me my personal profile page?
I want to update my email address.
How about that?
And then the code, whatever it's written in, is going to talk to my SQL.
It's going to say, Hey, my SQL.
This user with the user with the email of Colts at gmail.com is trying to get his profile page.
I want to select all information related to user select everything from users where email is cold to
gmail.com.
That query is run.
So from node or whatever this is here to my SQL and a result comes back.
And it could be, I'm sorry, there's no user's table.
I don't know what the heck you're talking about Node.
Or it could be okay, here's the five items in that row about cold and then that comes back.
So that's kind of this two way street and then whatever the programming language is here is then going
to compile whatever sent to me.
So the Amazon home page, so it's going to take all those results and it's going to build a web page
for me and send it back.
Now, this is not a course on Web development.
I have another video where we talk about what this course is and isn't and how I'm going to go about
covering things like HTML, CSS, I'm going to cover them, but not in a ton of detail because that
could take hours.
I have a 45 hour course on that content, so this is really more focused on the MySQL part of things,
which makes sense.
It's a MySQL course.
So with that said, oh, I missed the last arrow.
Something is sent back to a computer.
So it's a cycle where there's kind of three entities.
There's a device over here, my computer, it could be an iPhone or Android phone.
Could be, I don't know, it could be a smoke detector.
It could be a nest camera.
If you have ever seen nest cameras or any like web based security camera, they don't I'm not saying
they work with Node in my MySQL, but there's some database somewhere storing information and there's
some app somewhere running that is listening that's getting video sent back or updates from a smoke
alarm.
Or it could be a virtual reality headset.
It could be anything really, any sort of device, another computer, a phone, something else.
And then this here, like I said, doesn't have to be Node.
That's what we're working with.
But you could easily replace that with another language, PHP or Ruby.
And then yes, you could have a different database, but that's not what this course is about.
But you could have a virtual reality headset that's working with Ruby, although that's not a great
game development environment.
Maybe you're working with Unity and you're writing Java or something, but then you're working with
another database.
It could be anything MongoDB, PostgreSQL or MySQL.
The core idea is the same.
Okay, so there's a lot of talking.
Like I said, there's an optional video coming up about PHP versus Node and other languages and it's
mainly my opinions, but there is some interesting data to take a look at.
If you're curious about how I came to the conclusion I came to, I spent a lot of time thinking about
how to teach this.
And what I would like to do is add kind of alternate versions of what we're going to build here and
build a Ruby version so you can see it and then build a PHP version and build a Java version so you
can compare it.
But that will come later.
This is I made a decision and it's an informed decision and I'll explain why if you're curious in the
next video and then after that, or you can skip right to the next video, which is going to be introducing
the project we're going to build.