1 00:00:00,270 --> 00:00:00,990 All righty. 2 00:00:00,990 --> 00:00:06,810 So as I mentioned in the previous video, this section is a big turning point and hopefully you're excited 3 00:00:06,810 --> 00:00:07,440 about it. 4 00:00:07,560 --> 00:00:08,770 I'm excited to teach it. 5 00:00:08,790 --> 00:00:16,110 We're going to go from what we've been doing for the last 12, 13 ish hours of content, basically working 6 00:00:16,110 --> 00:00:22,440 with MySQL on its own, querying a database and getting a result printed back to us immediately, which 7 00:00:22,440 --> 00:00:27,750 is great, but we're going to go from that to creating applications with my SQL. 8 00:00:27,780 --> 00:00:33,000 We're not going to learn how to create complex video games or crazy iOS apps. 9 00:00:33,030 --> 00:00:36,700 We're focusing mainly on web applications, but the ideas are the same. 10 00:00:36,720 --> 00:00:43,020 I'm going to show you how you get an external language like JavaScript or PHP or Ruby to talk to my 11 00:00:43,020 --> 00:00:43,650 SQL. 12 00:00:43,650 --> 00:00:45,450 And we'll build a couple of things with that. 13 00:00:45,900 --> 00:00:51,120 Now let's quickly review what we've done, not the entire course, but the way we've been working and 14 00:00:51,120 --> 00:00:52,510 talk about the merits of that. 15 00:00:52,530 --> 00:00:58,290 So we've been working with the CLI mainly, you know, having a database of users or books or whatever 16 00:00:58,290 --> 00:01:05,670 it is and asking questions, you know, selecting sales data or orders data or customers and trying 17 00:01:05,670 --> 00:01:09,060 to figure things out like how much did we sell last week? 18 00:01:09,060 --> 00:01:12,870 Or What day of the week was our best selling day across the last two years? 19 00:01:13,200 --> 00:01:17,710 Those are really important and valid and just common uses of my SQL. 20 00:01:17,730 --> 00:01:23,190 So there is this whole subset of creating applications that we're diving into now, but there are tons 21 00:01:23,190 --> 00:01:28,260 and tons of jobs, lots of people who, when they work with my SQL, all that they do. 22 00:01:28,350 --> 00:01:33,300 Not to diminish it in any way because they can write some pretty complex queries, but they're working 23 00:01:33,300 --> 00:01:39,540 with only my SQL and they're opening up the CLI, or they're writing SQL files like we've seen, and 24 00:01:39,540 --> 00:01:41,430 they're just saving it and running those files. 25 00:01:41,610 --> 00:01:45,900 So they want to see, okay, what was my commission that I made in the last year? 26 00:01:46,860 --> 00:01:53,520 Calculating tax, whatever information, some summing a bunch of information in these tables or doing 27 00:01:53,520 --> 00:01:56,510 a complex join to figure out which promotion work the best. 28 00:01:56,520 --> 00:02:00,360 Those are really important and common uses that people do all the time. 29 00:02:00,360 --> 00:02:04,080 So it's not just about building applications, but we've seen that first part. 30 00:02:04,080 --> 00:02:05,100 We've seen how to do that. 31 00:02:05,100 --> 00:02:10,259 We've worked with tables, we've been writing lots of selects, inserts, updates, deletes, all of 32 00:02:10,259 --> 00:02:10,690 that. 33 00:02:10,710 --> 00:02:13,500 Now we're going to see how we work with other languages. 34 00:02:14,670 --> 00:02:19,800 So now it's time for my SQL plus any of these, pick one. 35 00:02:19,950 --> 00:02:23,850 And the reason I'm even showing you this page is not to intimidate you, not to make you think. 36 00:02:23,850 --> 00:02:25,160 You need to know all of these. 37 00:02:25,170 --> 00:02:26,590 You only need one. 38 00:02:26,610 --> 00:02:31,890 So depending on what you're doing, there are strengths and and disadvantages to certain languages. 39 00:02:32,340 --> 00:02:34,790 But really, all of these will work. 40 00:02:34,800 --> 00:02:37,260 They all have ways of communicating with my SQL. 41 00:02:37,410 --> 00:02:42,930 So if you're someone who is comfortable with the language, like if you grew up working with Java or 42 00:02:42,930 --> 00:02:47,640 you took a Python class in college or whatever it is, you can find ways. 43 00:02:47,690 --> 00:02:53,130 I'll talk about what they are of connecting my SQL and whatever language you're comfortable with. 44 00:02:53,160 --> 00:02:56,320 The one we're going to work with is called Node Node. 45 00:02:56,580 --> 00:02:59,160 JS It's getting very, very popular. 46 00:02:59,160 --> 00:03:01,380 It's been pretty popular for the last couple of years. 47 00:03:01,380 --> 00:03:06,000 Very versatile language, lots and lots of users, great documentation out there. 48 00:03:06,090 --> 00:03:08,520 Now we could have also gone with PHP. 49 00:03:08,550 --> 00:03:10,320 Some of you may be wondering about that. 50 00:03:10,770 --> 00:03:18,090 PHP and MySQL historically have been a bit of an item, a couple that were spotted together all the 51 00:03:18,090 --> 00:03:18,690 time. 52 00:03:18,690 --> 00:03:22,140 In the next video I will talk a bit about PHP. 53 00:03:22,140 --> 00:03:25,590 It's totally optional, but I didn't want to bog you down in this video with it. 54 00:03:25,590 --> 00:03:27,900 But there are a lot of opinions out there. 55 00:03:27,930 --> 00:03:29,990 I'll give you a 10/2 preview. 56 00:03:30,060 --> 00:03:32,130 A lot of people think PHP is dying. 57 00:03:32,130 --> 00:03:35,040 It's certainly in decline compared to where it used to be. 58 00:03:35,040 --> 00:03:37,350 It used to be the king of programming languages on the web. 59 00:03:37,380 --> 00:03:41,010 Now there are lots of competitors and people are leaving PHP. 60 00:03:41,040 --> 00:03:42,720 That doesn't mean that it's a bad language. 61 00:03:42,720 --> 00:03:44,010 There are problems with it. 62 00:03:44,010 --> 00:03:45,960 This is my opinion as well. 63 00:03:45,960 --> 00:03:50,160 There are problems that other languages have been able to solve better. 64 00:03:50,160 --> 00:03:52,740 However, there's a big user base out there. 65 00:03:52,740 --> 00:03:57,030 Yes, it's not growing as fast every year, but there are still millions of people using it. 66 00:03:57,030 --> 00:04:01,650 So do not shy away from PHP if you're comfortable with it, if you want to use it. 67 00:04:01,650 --> 00:04:06,990 There's lots of examples out there, but I didn't want to make this course just another PHP in my SQL 68 00:04:06,990 --> 00:04:07,320 course. 69 00:04:07,320 --> 00:04:08,430 There are dozens. 70 00:04:08,430 --> 00:04:13,860 They're getting dated, but there are dozens of them even on Udemy, lots of my SQL and PHP. 71 00:04:14,160 --> 00:04:18,660 So I chose Node and I'll talk more about why in this optional video coming up. 72 00:04:18,660 --> 00:04:25,290 Basically, JavaScript is the most popular programming language for the web right now and Node uses 73 00:04:25,290 --> 00:04:30,870 JavaScript syntax and just generally Node is a great choice and I could have gone with any of these, 74 00:04:30,870 --> 00:04:35,310 although I probably wouldn't have done any of the C languages, but Ruby or Python would have been equally 75 00:04:35,310 --> 00:04:36,270 good choices. 76 00:04:36,690 --> 00:04:41,370 However, I went with Node because honestly, that's what people want to learn right now and it's what 77 00:04:41,370 --> 00:04:42,900 a lot of the jobs out there are for. 78 00:04:43,590 --> 00:04:45,270 So that's all I'll say about that for now. 79 00:04:45,780 --> 00:04:47,820 Like I said, any of these will work. 80 00:04:48,000 --> 00:04:50,940 The next thing I want to talk about is how do they work? 81 00:04:50,940 --> 00:04:51,630 What do they do? 82 00:04:51,630 --> 00:04:55,860 So we pick a language, we're working with Node, but then what? 83 00:04:56,020 --> 00:04:59,910 What's the point of using a program, a programming language? 84 00:05:00,100 --> 00:05:04,240 How does it talk to my SQL through external code and what kinds of things would you do? 85 00:05:04,720 --> 00:05:06,130 So here's a little diagram. 86 00:05:07,240 --> 00:05:10,600 Imagine that there's a web application on my computer. 87 00:05:10,600 --> 00:05:15,310 When I go to this hypothetical Amazon.com, I hit enter. 88 00:05:15,940 --> 00:05:20,320 A request is made and I labeled this as Node.js. 89 00:05:20,350 --> 00:05:25,630 Amazon does have some node in their stack, but this could be any language, so that doesn't matter. 90 00:05:25,630 --> 00:05:27,420 But I send a request. 91 00:05:27,430 --> 00:05:32,560 Hey Amazon, can you give me your home page or can you give me my personal profile page? 92 00:05:32,560 --> 00:05:34,090 I want to update my email address. 93 00:05:34,090 --> 00:05:34,750 How about that? 94 00:05:35,200 --> 00:05:40,600 And then the code, whatever it's written in, is going to talk to my SQL. 95 00:05:40,960 --> 00:05:42,790 It's going to say, Hey, my SQL. 96 00:05:43,420 --> 00:05:50,230 This user with the user with the email of Colts at gmail.com is trying to get his profile page. 97 00:05:50,470 --> 00:05:57,760 I want to select all information related to user select everything from users where email is cold to 98 00:05:57,790 --> 00:05:58,690 gmail.com. 99 00:05:59,230 --> 00:06:00,580 That query is run. 100 00:06:00,580 --> 00:06:05,860 So from node or whatever this is here to my SQL and a result comes back. 101 00:06:06,010 --> 00:06:09,040 And it could be, I'm sorry, there's no user's table. 102 00:06:09,040 --> 00:06:10,840 I don't know what the heck you're talking about Node. 103 00:06:10,840 --> 00:06:17,740 Or it could be okay, here's the five items in that row about cold and then that comes back. 104 00:06:18,310 --> 00:06:24,610 So that's kind of this two way street and then whatever the programming language is here is then going 105 00:06:24,610 --> 00:06:26,590 to compile whatever sent to me. 106 00:06:26,590 --> 00:06:32,140 So the Amazon home page, so it's going to take all those results and it's going to build a web page 107 00:06:32,140 --> 00:06:33,730 for me and send it back. 108 00:06:34,180 --> 00:06:36,370 Now, this is not a course on Web development. 109 00:06:36,640 --> 00:06:41,500 I have another video where we talk about what this course is and isn't and how I'm going to go about 110 00:06:41,500 --> 00:06:47,290 covering things like HTML, CSS, I'm going to cover them, but not in a ton of detail because that 111 00:06:47,410 --> 00:06:48,100 could take hours. 112 00:06:48,100 --> 00:06:54,910 I have a 45 hour course on that content, so this is really more focused on the MySQL part of things, 113 00:06:54,910 --> 00:06:55,840 which makes sense. 114 00:06:55,840 --> 00:06:57,040 It's a MySQL course. 115 00:06:57,550 --> 00:07:00,790 So with that said, oh, I missed the last arrow. 116 00:07:01,150 --> 00:07:03,400 Something is sent back to a computer. 117 00:07:03,400 --> 00:07:05,800 So it's a cycle where there's kind of three entities. 118 00:07:05,800 --> 00:07:11,320 There's a device over here, my computer, it could be an iPhone or Android phone. 119 00:07:11,320 --> 00:07:14,950 Could be, I don't know, it could be a smoke detector. 120 00:07:14,950 --> 00:07:16,660 It could be a nest camera. 121 00:07:16,660 --> 00:07:22,660 If you have ever seen nest cameras or any like web based security camera, they don't I'm not saying 122 00:07:22,660 --> 00:07:26,740 they work with Node in my MySQL, but there's some database somewhere storing information and there's 123 00:07:26,740 --> 00:07:33,190 some app somewhere running that is listening that's getting video sent back or updates from a smoke 124 00:07:33,190 --> 00:07:33,730 alarm. 125 00:07:35,350 --> 00:07:36,850 Or it could be a virtual reality headset. 126 00:07:36,850 --> 00:07:41,620 It could be anything really, any sort of device, another computer, a phone, something else. 127 00:07:41,950 --> 00:07:44,890 And then this here, like I said, doesn't have to be Node. 128 00:07:44,890 --> 00:07:46,030 That's what we're working with. 129 00:07:46,030 --> 00:07:50,380 But you could easily replace that with another language, PHP or Ruby. 130 00:07:51,160 --> 00:07:55,150 And then yes, you could have a different database, but that's not what this course is about. 131 00:07:55,150 --> 00:08:00,610 But you could have a virtual reality headset that's working with Ruby, although that's not a great 132 00:08:01,120 --> 00:08:02,380 game development environment. 133 00:08:02,380 --> 00:08:08,140 Maybe you're working with Unity and you're writing Java or something, but then you're working with 134 00:08:08,140 --> 00:08:08,830 another database. 135 00:08:08,830 --> 00:08:13,030 It could be anything MongoDB, PostgreSQL or MySQL. 136 00:08:13,390 --> 00:08:14,920 The core idea is the same. 137 00:08:14,920 --> 00:08:16,810 Okay, so there's a lot of talking. 138 00:08:17,290 --> 00:08:22,900 Like I said, there's an optional video coming up about PHP versus Node and other languages and it's 139 00:08:22,900 --> 00:08:26,260 mainly my opinions, but there is some interesting data to take a look at. 140 00:08:26,380 --> 00:08:30,970 If you're curious about how I came to the conclusion I came to, I spent a lot of time thinking about 141 00:08:30,970 --> 00:08:31,930 how to teach this. 142 00:08:32,620 --> 00:08:39,190 And what I would like to do is add kind of alternate versions of what we're going to build here and 143 00:08:39,190 --> 00:08:44,260 build a Ruby version so you can see it and then build a PHP version and build a Java version so you 144 00:08:44,260 --> 00:08:45,130 can compare it. 145 00:08:45,850 --> 00:08:47,560 But that will come later. 146 00:08:47,560 --> 00:08:52,240 This is I made a decision and it's an informed decision and I'll explain why if you're curious in the 147 00:08:52,240 --> 00:08:58,000 next video and then after that, or you can skip right to the next video, which is going to be introducing 148 00:08:58,000 --> 00:08:59,320 the project we're going to build.