Difficulty: Beginner
Estimated Time: 30

Welcome to this Bash basics training guide!

This Introduction to SQL interactive guide is based on the Open-source Introduction to SQL eBook.

This is an open-source introduction to SQL guide that will help you learn the basics of SQL and start using relational databases for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you will most likely have to use SQL at some point in your career.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of SQL.

Conclusion

Congratulations! You have just completed the SQL basics guide!

If you found this helpful, be sure to star the project on GitHub!

If you have any suggestions for improvements, make sure to contribute pull requests or open issues.

In this introduction to SQL eBook, we just covered the basics, but you still have enough under your belt to start working with any relational database out there!

As a next step, try to create a database server, import some demo data, and play around with all of the statements that you've learned so far. You can also take a look at this website here to help you build your tables and relations and visualize them:

https://dbdiagram.io/

In case that this eBook inspired you to contribute to some fantastic open-source project, make sure to tweet about it and tag @bobbyiliev_ so that we could check it out!

Congrats again on completing this eBook!

Other eBooks

Some other opensource eBooks that you might find helpful are:

Introduction to SQL

Step 1 of 12

Databases

Before we dive deep into SQL, let's quickly define what a database is.

The definition of databases from Wikipedia is:

A database is an organized collection of data, generally stored and accessed electronically from a computer system.

In other words, a database is a collection of data stored and structured in different database tables.

Tables and columns

You've most likely worked with spreadsheet systems like Excel or Google Sheets. At the very basic, database tables are quite similar to spreadsheets.

Each table has different columns which could contain different types of data.

For example, if you have a todo list app, you would have a database, and in your database, you would have different tables storing different information like:

  • Users - In the users table, you would have some data for your users like: username, name, and active, for example.
  • Tasks - The tasks table would store all of the tasks that you are planning to do. The columns of the tasks table would be for example, task_name, status, due_date and priority.

The Users table will look like this:

+----+----------+---------------+--------+
| id | username | name          | active |
+----+----------+---------------+--------+
| 1  |    bobby | Bobby Iliev   |   true |
| 2  |    grisi | Greisi I.     |   true |
| 3  |  devdojo | Dev Dojo      |  false |
+----+----------+---------------+--------+

Rundown of the table structure:

  • We have 4 columns: id, username, name and active
  • We also have 3 entries/users
  • The id column is a unique identifier of each user and is auto-incremented.

In the next chapter, we will learn how to install MySQL and create our first database.