close
Cart icon
User menu icon
User icon
Lightbulb icon
How it works?
FAQ icon
FAQ
Contact icon
Contact
Terms of service icon
Terms of service
Privacy policy icon
Privacy Policy
Zdjęcie główne artykułu.

SQL - key terms and concepts

What is SQL

You have some data stored in a database. For example, a list of employees. Or a list of orders. And you need to display this list right now. How will you do it? By writing a query to the database.

To display the data, you write something like this:

SELECT amount, date, tax FROM orders;

And there you have the data you so desperately need. That's the whole idea behind the SQL language. With it, you simply write queries that operate on the database. These can be queries that pull data out of the database. But you can also use SQL to modify, add, or delete data. You can perform any operation you want.

Key concepts - database, tables, queries and relations

When it comes to databases, it's a good idea to start by understanding a few key terms.

Database - is a collection of structured information. For example, an online store database.

Table - is a fragment of the database, concerning one subject. We have our sample store database. Each fragment of this database will have its own separate table. Customers are in one table. Orders are in another one. A separate table will be needed for products and so on.

Relations - a mechanism that allows you to logically combine data from different arrays. In our example database, we need to somehow relate products to orders. Orders with customers, etc.

The SQL language operates on these elements. You can use it to work freely with the database. Read the contents of any table. Insert data into a table. Define relationships between tables. Create new tables. Delete data and tables. Create new databases. All this can be done with properly written queries.

SQL language syntax and elements

SQL has its own specific syntax. Thanks to this database understands our queries. If you want to write a query, you must strictly stick to this syntax.

If you want to pull data from a table then you need to do it more or less like this:

SELECT column_name FROM table_name;

In SQL, you have separate syntax elements for queries that extract data, modify it, add new data, etc.

And this is where you need to start learning SQL. From the most important elements of the syntax, because without it you cannot 'communicate' with the database.

Implementation - MySQL, SQL Server, PostgreSQL

SQL is a language for writing queries that operates on a database. In practice, we have different implementations of databases. This means that there are different varieties of databases that SQL operates on.

In each of these variations, we write the query in roughly the same way. There may be some minor differences. There may be techniques specific to a database of a particular type. But the query writing itself will usually be based on standard SQL syntax.

Here are popular SQL-based databases:

  • MySQL
  • SQL Server
  • PostgreSQL
  • SQLite

This list is of course longer, but don't let it bother you for now. If you know the syntax of SQL and learn how to write queries, you will be fine. Regardless of what type of database you will have to deal with in practice.

An important skill but not sufficient on its own

SQL is a very specific subject. The ability to use this language is beneficial in countless fields. Usually, however, knowledge of SQL alone is not enough. In practice, SQL is just a tool and a complement to other skills.

A back-end developer uses SQL because he writes database-driven applications. A business analyst uses SQL to extract the information he is interested in from the database. The administrator manages the configuration and structure of the database.

So for each of these people, SQL knowledge is a mean to the final product. But not the main tool. Therefore, learn first what you need in a given field. And treat SQL as an important (sometimes even necessary) addition to your basic skills.

Perhaps your current or future job doesn't require working directly with queries. However, knowledge of SQL can be a great asset that will set you apart from other candidates.

It can also be the case that you will be working with SQL right away and then there is no other choice but to learn the language properly. It is not difficult. The basic syntax is simple. Especially in comparison with typical programming languages.

Author - Codenga