You have a dataset of sails and you wannt to know which seller is third spot in sales. How would you write the query?
Technologies used in this roject:
In this project I show 3 queries which gives the same result, but with their performances totally diferent.
To build this project I use MySQL running in docker and DBeaver interface. If you want to reproduce this project you can follow the intallation steps in this link: https://medium.com/@edu18ds/running-mysql-in-container-docker-and-setting-dbeaver-5f9e5781649d
The dataset and scripts are in this repository.
The picture below shows the dataset:
In spite of having the same result, the cost of each query is diferent. So, depending on the amount of data it is very important to stay stuned in performance issue. When we limit the amount of lines we can get better performances. It is important to mention that the first query has the best performance and it is more readable.