Introduction

SQL and 1010data store their data in very different ways, therefore the way you treat your data in each language needs to be different as well. SQL is a relational database, and the data is stored in rows, allowing for data to be easily added and removed. Contrastingly, 1010data is an analysis-first database, and the data is stored in columns, allowing for various analyses to be executed over large amounts of data, more efficiently in many cases.

When looking at each analogue, you might notice that there are multiple 1010data solutions for one SQL solution. Each analogue attempts to illustrate a direct translation from SQL to 1010data, however sometimes this direct translation might not be the most efficient solution for 1010data's platform. Therefore, the most efficient solution will be listed as the main solution, while the alternate solutions shown contain a different approach to solve the problem. It is also important to note that each SQL solution is created using MySQL, and therefore there might be alternative ways to solve the problem using different functions and operations that are not available in MySQL.

When using SQL, you need to think about what you want your end result to be, and which steps will get you there. Most often, you will have to create your query in such a way that all commands are nested within each other, using a series of JOIN's and/or UNION's, or you will need to create intermediate tables containing your results at each point in your query in order to use these results in the next step. You cannot simply enter in commands as you progress, building on the query as you go. And if you decide to make a change in your query at any point in time, you need to resubmit your whole query from the beginning with the change added. With 1010data, you're able to build on your query as you go. This is because 1010data preserves the state of your session and stores the results of your queries in your cache. Also, this eliminates the need to materialize intermediate tables to use in your query.