Should I learn SQL

What's the fastest way to learn SQL?

Which SQL commands do I have to master at least in order to be able to claim: "I can SQL"? How do I best do it, where can I find practice examples and a suitable learning environment? Here are a few tips for SQL beginners: inside.

Databases in particular are often queried with the help of SQL. The absolute minimum is therefore the mastery of the SELECT command in all variations with SELECT .. FROM .. WHERE .. ORDER BY. If you also have to calculate, aggregate functions such as SUM, MIN, MAX, COUNT belong on the topic list, as well as the associated groupings (GROUP BY .. HAVING ..). Since the data to be queried rarely comes from just one table or view, you also have to deal with JOINs of all kinds. Finally, comparison operators like IN, BETWEEN, NOT, LIKE are indispensable. If you really have mastered all of this, you are already quite far ahead and can thus cover complex requirements, e.g. in reporting. However, all of this is only a small part of SQL and is known as DQL (Data Query Language).

SQL is much more than just a query language

In addition, there are commands for creating, changing and deleting data (INSERT, UPDATE, DELETE) - keyword DML (Data Manipulation Language). Of course, you also have to master this if you have to do not only with the query but also with the acquisition and maintenance of the data. Anyone who also creates and changes databases, tables, views, etc. needs the DDL (Data Definition Language) with commands such as CREATE / ALTER / DROP TABLE, VIEW, CONSTRAINT, INDEX, ... Finally, you can also use the rights assignment (GRANT, REVOKE ), Transactions or the programming of complex functions and store procedures, e.g. in T-SQL (Microsoft SQL Server) or PL / SQL (Oracle).

From reality to the database model

In order to successfully create your own databases, you also have to know how to translate reality into a database model. For this purpose, objects (also called entities in the world of databases) and their properties as well as the relationships between the objects must be identified and defined. The objects and relationships determined on the basis of such a so-called entity relationship model are then transferred to database tables.

Step by step to the goal

Time needed: 10 days.

So how can you learn SQL quickly and effectively in view of this wealth of tasks? I recommend the following procedure:

  1. Don't waste time in the beginning.

    Don't worry about installing and administering a real, large database system right away. This is a job in itself. Instead, just use one of the SQL platforms available on the Internet. For example, I love sqliteonline.com and like to use this system for manufacturer-independent SQL training courses. You can just get started and don't have to worry about anything (except for a sample database, if you don't want to create one yourself right away)

  2. Make the first attempts to walk.

    Use the excellent free tutorials and sample databases available on the Internet such as Chinook or Northwind.

  3. Find simple examples.

    For simple examples from your real world, try to define the correct tables and fields. Imagine, for example, that you want to provide a restaurant with new software and manage the rooms, tables and reservations in a database. Or put yourself in the position of a small supermarket with product groups, articles, cashiers and purchases. Think about your sports club and of course any professional issues that could benefit from a database.

  4. Exchange ideas with other learners.

    Introduce your designs to each other and discuss different ways, advantages and disadvantages of different modeling approaches. There is not always one perfect solution. You can also hire an SQL coach if you'd rather discuss your ideas with a professional.

  5. Specialize.

    Only then do you specialize in the database system with which you will later work productively and learn everything about it. SQL is theoretically standardized, but every manufacturer is free to omit parts of the standard and to provide other non-standard functions.

I wish you success!