Locked lesson.
About this lesson
Quick reference
An Overview of SQL
SQL is the language we use to program databases.
When to use
Anytime you want to put data in, take data out, or use databases programmatically - you'll use SQL.
Instructions
SQL is the programming language of databases. It allows us to do things to databases programmatically.
The type of Database you use will determine the type of SQL you'll use. In our case, we'll be using T-SQL because we are using Microsoft SQL Server. The different versions of SQL are so similar that you will be able to apply most of what you learn to many other databases such as MySQL, PostgreSQL, Oracle and more.
SQL is easy to learn, and very straightforward to use because it is close to spoken English.
Hints & tips
- SQL stands for Structured Query Language
- We'll be using T-SQL in this course
- 00:05 In this video I want to talk about SQL.
- 00:07 What is it?
- 00:08 What do we use it for?
- 00:09 And what's it all about?
- 00:10 I find that the concept of SQL kind of confuses people at first.
- 00:14 Is it the database, is it the language, what is it?
- 00:17 Well SQL, strictly speaking, stands for Structured Query Language.
- 00:21 SQL, we pronounce it sequel.
- 00:23 And it's sorta like the programming language for databases.
- 00:27 It's what we type in to get stuff out of a database, or to put stuff into a database.
- 00:33 It allows us to programatically work with databases automatically.
- 00:37 When you have a database, you can actually enter things by hand into the database.
- 00:41 Generally you don't do that, you use SQL to enter it automatically.
- 00:44 So if somebody goes to a website and fills out a form and
- 00:47 you wanna add that information that they put in the form into a database.
- 00:50 You're gonna write a little script, a SQL script that does that for you.
- 00:54 So I just went to Wikipedia really quickly just to show you a couple of things.
- 00:58 Structure Query Language, it's just a name of it.
- 01:00 It's based on some algebra or calculus or
- 01:03 something, you don't need to know any of that stuff.
- 01:05 But I did wanna kinda scroll down here and show you this table,
- 01:09 and there's all kinds of different types of SQL.
- 01:13 And this is what confuses a lot of people.
- 01:15 There's all these different versions, there's probably a lot more different
- 01:18 versions and they all go with different types of databases.
- 01:20 So MySQL uses this SQL/PSM.
- 01:24 Microsoft, which is what we are going to be working with in this course,
- 01:27 they use something called T-SQL, which stands for Transact SQL.
- 01:31 SAP uses HANA, and so this is just a short list I think there's many, many more.
- 01:36 If we just click on this Transact SQL.
- 01:38 Basically, most SQL is the same.
- 01:40 These are just slight variations, like Microsoft decided to develop their
- 01:45 own little version of SQL and they called it T-SQL.
- 01:48 So that's what we use because we're using Microsoft databases.
- 01:51 The database that you use will determine the type of SQL that you use.
- 01:56 Like I said, in our case, we're gonna be using Microsoft SQL Server so
- 01:59 we're gonna use their T-SQL, and most of the time you don't even realize.
- 02:03 I mean, these things are all so similar, all the different versions.
- 02:07 They might be slightly different here or there and
- 02:08 you kinda learn the differences as you're using them.
- 02:11 So basically, SQL is very, very easy to use.
- 02:15 It's so easy I don't think you can even really call it a programming language.
- 02:19 It's not like the C programming language, or Ruby, or
- 02:22 Python, or JavaScript, it's not like that, it's not that hard.
- 02:26 It's more like HTML, it's a loose combination of things that you can type.
- 02:30 And we start most SQL with the SELECT command.
- 02:33 And let's say we want every database are made up of columns and rows.
- 02:38 So we want everything from the FIRST_NAME
- 02:42 column from our CUSTOMER_DB where the AGE
- 02:47 of the person is greater than 21.
- 02:52 Right, this is a valid, usually it's sorta indented.
- 02:55 This is a valid SQL command and they dont get much more complicated than this.
- 03:00 Now we can add more intricate things to them and
- 03:02 we're going to learn all this later on but I just want to show you it's this simple.
- 03:05 It's very much like spoken English where we're selecting
- 03:10 a thing from a thing where a thing.
- 03:13 It makes sense, you can read it and not really even know what it is, but
- 03:16 still understand sort of what's going on.
- 03:18 A lot of times marketers who have no computer programming experience
- 03:22 whatsoever, they all know SQL these days, because marketers need analytics and
- 03:26 analytics come from databases.
- 03:28 So a lot of marketers have had to learn SQL, and
- 03:31 they find that it's very easy to do.
- 03:34 So we're going to dive into this in great detail throughout this course.
- 03:37 Most of what we're going to be learning is how to use SQL.
- 03:39 And I think you're going to find that it's really fun and pretty easy to use.
- 03:42 So in the next video we're going to look at RDBMS concepts.
Lesson notes are only available for subscribers.