1 00:00:00,090 --> 00:00:05,100 So in this video, we're going to talk about one of the more common questions that comes up early on, 2 00:00:05,100 --> 00:00:09,890 which is what is the difference between my SQL and SQL? 3 00:00:09,990 --> 00:00:14,170 Or I usually just say SQL, but what's the difference between these two? 4 00:00:14,190 --> 00:00:18,000 Obviously, SQL is contained in the name of my SQL. 5 00:00:18,390 --> 00:00:19,980 What's the significance of that? 6 00:00:21,060 --> 00:00:27,930 So let's start off with discussing SQL, which stands for Structured Query Language. 7 00:00:28,140 --> 00:00:34,110 So SQL is the language that we use when we talk to our databases. 8 00:00:34,590 --> 00:00:42,810 It's the way that we interact and access the data, update data, delete things and basically manipulate 9 00:00:42,810 --> 00:00:44,520 the data in our databases. 10 00:00:44,790 --> 00:00:46,380 It's the language we use. 11 00:00:46,830 --> 00:00:50,250 So it's how we do things like find all users. 12 00:00:50,940 --> 00:00:53,610 Now what I'm showing you here is not actual SQL code. 13 00:00:53,910 --> 00:00:55,470 You'll see that in just a second. 14 00:00:55,590 --> 00:00:57,990 These are just humanized versions. 15 00:00:58,500 --> 00:01:07,170 Find all users who are 18 years old, add a new user with username Jambo Jim or if we want to get crazy, 16 00:01:07,170 --> 00:01:08,640 delete every single user. 17 00:01:08,640 --> 00:01:12,990 So these are the sort of things that we use SQL to do. 18 00:01:12,990 --> 00:01:19,710 So we write these lines which are called queries, structured query language, and once we hit enter 19 00:01:19,710 --> 00:01:25,170 or once we run that SQL code, it's executed and it goes off and it talks to our database and it does 20 00:01:25,170 --> 00:01:26,010 it for us. 21 00:01:27,090 --> 00:01:31,920 So if you are curious of what it looks like, here's a really quick one line preview. 22 00:01:33,030 --> 00:01:42,960 The English version Find all users who are 18 or older is translated into this select star from users 23 00:01:42,960 --> 00:01:46,860 where age is greater than or equal to 18 semicolon. 24 00:01:47,520 --> 00:01:50,250 So hopefully that actually seems pretty straightforward. 25 00:01:50,340 --> 00:01:54,480 Now we're going to dive into SQL all throughout this course. 26 00:01:54,900 --> 00:01:57,150 You don't need to worry about this exact statement. 27 00:01:57,150 --> 00:02:03,480 What's important though, is that you can see there is a special syntax we use and that this query here 28 00:02:03,480 --> 00:02:06,750 is going to be sent off to interact with the database somewhere. 29 00:02:07,080 --> 00:02:14,040 So the next point I want to make is that when we work with my SQL, we're actually writing SQL all the 30 00:02:14,040 --> 00:02:14,610 time. 31 00:02:15,000 --> 00:02:21,810 So my SQL is what we talked about earlier, a database management system, and there's a bunch of them 32 00:02:21,810 --> 00:02:22,500 out there. 33 00:02:23,340 --> 00:02:30,090 Here's some common ones PostgreSQL, SQL Light, Oracle, there's hundreds of others, and there's dozens 34 00:02:30,090 --> 00:02:34,710 of popular ones, but hundreds of them all over the world that maybe aren't as popular. 35 00:02:35,040 --> 00:02:41,790 So all of these ones here that I've highlighted use SQL or SQL, that doesn't mean every database ever 36 00:02:41,790 --> 00:02:45,000 does, but what are called relational databases do. 37 00:02:45,000 --> 00:02:48,000 And we'll talk more about that later when we discuss tables. 38 00:02:48,000 --> 00:02:55,000 But for now, the point I want to make is that SQL is not unique to my SQL or to post. 39 00:02:55,000 --> 00:02:58,740 Guess that's why they all have this SQL in their name. 40 00:02:58,920 --> 00:03:00,900 They share this language. 41 00:03:00,900 --> 00:03:09,570 So structured Query language SQL is a standard basically that these relational database management systems 42 00:03:09,570 --> 00:03:11,370 like my SQL implement. 43 00:03:11,370 --> 00:03:14,310 So it's kind of a lot of jargon and terminology again. 44 00:03:14,310 --> 00:03:20,490 But the main takeaway is that when we use something like SQL, we'll actually be writing SQL all the 45 00:03:20,490 --> 00:03:20,970 time. 46 00:03:21,930 --> 00:03:30,300 So here's an example of what a line of SQL code looks like to do the exact same thing in a my SQL database 47 00:03:30,300 --> 00:03:32,340 and a post stress database. 48 00:03:33,450 --> 00:03:39,750 Here's the my SQL and here's the post graphs and hopefully you notice they are identical. 49 00:03:39,750 --> 00:03:43,380 Both of these are different database management systems. 50 00:03:44,010 --> 00:03:48,360 They have differences to them, but they both use SQL. 51 00:03:48,390 --> 00:03:51,750 You will be writing SQL when you interact with these databases. 52 00:03:53,250 --> 00:03:56,760 So just to hit that home, there are slight differences in the syntax. 53 00:03:56,760 --> 00:04:01,200 They are not identical, but they're very, very similar. 54 00:04:02,250 --> 00:04:06,240 Oh, and I better not forget to mention the SQL standard. 55 00:04:06,240 --> 00:04:11,310 So the way that this whole thing works is that there is a standard for how SQL should work. 56 00:04:11,670 --> 00:04:13,560 It's it's actually written down. 57 00:04:13,560 --> 00:04:14,850 You can read it online. 58 00:04:14,850 --> 00:04:21,870 And all of these different database management systems basically are tasked with implementing that standard 59 00:04:21,870 --> 00:04:23,760 in their own database and making it work. 60 00:04:23,760 --> 00:04:28,770 And they deviate sometimes a little bit, but for the most part they're very, very similar. 61 00:04:29,610 --> 00:04:36,810 So the two takeaways here, one is that once you learn SQL, it's really not that hard to switch to 62 00:04:36,810 --> 00:04:39,270 another database that also uses SQL. 63 00:04:39,270 --> 00:04:41,190 So you're learning my SQL. 64 00:04:41,220 --> 00:04:47,940 You could pretty easily switch to post grass or to SQL light with not a lot of time needed to get up 65 00:04:47,940 --> 00:04:48,600 to speed. 66 00:04:49,320 --> 00:04:55,680 And the second thing is that what makes databases or database management systems, to be specific, 67 00:04:55,680 --> 00:04:59,700 what makes them unique are the features that they offer. 68 00:05:00,210 --> 00:05:03,090 Not the sequel or the language itself. 69 00:05:03,090 --> 00:05:08,490 So if we go back to this diagram, all of these use SQL, but that doesn't mean that they're identical. 70 00:05:08,880 --> 00:05:13,050 And yes, you might write the same line of code to do the same thing here. 71 00:05:13,320 --> 00:05:19,890 So what makes these different are the features that they implement, things like how secure is one versus 72 00:05:19,890 --> 00:05:22,330 the other or how how fast is it? 73 00:05:22,350 --> 00:05:23,010 How much? 74 00:05:23,010 --> 00:05:24,570 How big is the download? 75 00:05:25,380 --> 00:05:27,200 How do user permissions work? 76 00:05:27,210 --> 00:05:28,260 And on and on and on? 77 00:05:28,260 --> 00:05:33,120 And we'll talk more about what those differences are when we get to a point where they actually make 78 00:05:33,120 --> 00:05:34,110 a little bit more sense. 79 00:05:34,110 --> 00:05:35,400 I don't want to just talk at you. 80 00:05:36,480 --> 00:05:40,320 So this was about my SQL versus SQL. 81 00:05:40,410 --> 00:05:42,570 SQL is structured query language. 82 00:05:42,570 --> 00:05:45,210 It exists separately from my SQL. 83 00:05:45,570 --> 00:05:50,100 And my SQL is a database management system that implements SQL.