Learning SQL is not a daunting task; it's quite the opposite. SQL is one of the few technical skills that is surprisingly fun and easy to learn.
With SQL, you can simplify your daily activities, like managing your bookshelf, personal finances, and fitness data.
For anyone in software engineering, understanding SQL is crucial when working with relational databases. Fortunately, the nature of SQL makes learning easy and fun, so you don't have to worry about it being difficult.
In this blog, we will delve into SQL and show you how simple it is to learn.
So, let's get started and discover the wonders of SQL together!
Exploring How Easy SQL Really Is
SQL is a database language used to interact with and manage data stored in relational databases. This includes:
- retrieving data from a database table
- inserting data in a database table
- updating data in a database table
- deleting data in a database table, and many more
Let's illustrate this with an example.
Suppose we have a table named Books.
Retrieve Data with SQL
Let's say you want to get a list of books written by J.K Rowling. Instead of manually searching the whole table, we use SQL.
SELECT title, author
FROM Books
WHERE author = "J. K. Rowling";
Output
Now let's say you want to filter the lists of books that are under $20.
SELECT title
FROM Books
WHERE price < 20;
Output
The above SQL codes are the most satisfying piece of computer command. It runs and rewards with an output. It's fun to play around. And it's in the language you understand.
As it's fun and easy, exploring more SQL won't hurt anybody.
Update Data with SQL
The price of Attack on Titan looks outdated. Let's update its price.
UPDATE Books
SET price = 26
WHERE title = "Attack on Titan";
And the new price is updated to 26 just like that.
Note: The table we've used is small, so it might not make sense to use SQL to update the price of just one book. But in real life, the database tables can be enormous. And that's when SQL comes in handy.
We can't cover everything about SQL in one blog, but we've hopefully fulfilled the blog's purpose, i.e., to prove SQL indeed is easy.
If you want to learn more, try to Learn SQL Basics on Programiz PRO. This interactive course is an excellent resource that makes learning SQL simple and informative.
Subscribe to Programiz PRO Blog!
Be the first to receive the latest tutorial from Programiz by signing up to our email subscription. Also more bonus like inside looks on the latest feature and many more.