Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Structured Query Language or SQL is the common language that lies at the heart of not only Microsoft SQL Server, but every RDBMS that you're likely to use. Now, you've probably noticed the different pronunciation of this. Some people say "Sequel." Others say "S-Q-L." I tend to say S-Q-L when I talk about the original language itself and "Sequel" when it's combined as an SQL Server, T-SQL or MySQL. SQL the language has been around since the 70s. It's actually one of the few languages that I was writing 25 years ago and I'm still writing now.
A lot of programming languages have come and gone, become fashionable and unfashionable, but SQL has stuck around and I still expect it to stay for a long time to come. Now SQL is a pretty small language and the key to learning it is to understand that it's a little different from other programming languages you might have come across, things like C, Java, or Python. SQL is what's called a declarative language whereas those others are what are referred to as procedural or imperative languages. Okay, this is jargon, yes.
What it means with a declarative language is that you use SQL to describe what you want and you let the database management system handle how that's actually done. You don't have to manually layout the algorithm, the different steps of the procedure, as you would do in other programming languages. So let's say we have got a thousand different products and I want to know which of these products have a price of less than a hundred dollars. Well, in a procedural or imperative language like C or Java, I would describe the steps to do this.
I would write some code that would loop through all the individual products one by one, and every time I went through the loop, I will have to ask the question again, is this less than a hundred? If so, do one thing. If not, do another thing. Even in pseudocode it looks complex. I would be writing a loop, I would be writing conditions, I would be writing return statements. That's a procedural language, but in SQL you describe what you want. In English, you would say I want all products less than $100. That written in SQL is this: SELECT * FROM products WHERE price < hundred.
No conditions, no loops, no return statements. Just the description. The database management system will look at your data, it will figure it out, and it will take this and return what's called the result set, whether this is one product or five hundred products or even none, based on this query. So SQL can be used to retrieve or read your data and ask questions of it. But it can also be used to create data, to update it, and to delete it.
This Create, Read, Update and Delete is often referred to with a wonderful acronym of CRUD. But SQL can be used actually to create the databases themselves as well. Now, this module is about something called T-SQL. That's because most database management systems have their own implementation of the core SQL language. If you work with Oracle, you're using something called PL/SQL. We're working with Microsoft SQL Server and Microsoft's flavor of SQL they call Transact-SQL or T-SQL for short.
It's still SQL at heart, but there are a few simple things added to it that will come in handy later on. SQL is a language you can learn in a few hours and be using it for decades. Get rid of all the fancy GUI interfaces, the query builders and the qizards and you can still do anything you need to do to a database as long as you have a command line prompt and know a little SQL.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 91186 Viewers
80 Video lessons · 138183 Viewers
59 Video lessons · 57007 Viewers
52 Video lessons · 70645 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.