Is SQL Hard to Learn?

Is SQL Hard to Learn?

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.

book_id

title

author

price

1

Harry Potter and the Goblet of Fire

J. K. Rowling

25

2

Lord of the Rings

J.R.R. Tolkien

45

3

Harry Potter and the Cursed Child 

J. K. Rowling

55

4

Attack on Titan

Hajime Isayama

18

5

Fantastic Beasts and Where to Find Them

J. K. Rowling

35


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";
SQL to list the books by J.K. Rowling

Output

title

author

Harry Potter and the Goblet of Fire

J. K. Rowling

Harry Potter and the Cursed Child 

J. K. Rowling

Fantastic Beasts and Where to Find Them

J. K. Rowling


Now let's say you want to filter the lists of books that are under $20.

SELECT title
FROM Books
WHERE price < 20;
SQL to filter the books under $20

Output

title

price

Attack on Titan

18


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";
SQL to update the price of book

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.