Aprendiendo a ordenar los datos de las consultas en SQL ['ESP','ENG']

avatar

En SQL se pueden aprenden muchísimas cosas, es un lenguaje de programación con muchos años en el mundo de desarrollo y ha llegado a niveles muy eficientes para trabajar datos, logrando consultas eficientes y filtradas de las maneras que sean necesarias para el trabajo.
Aun soy novato y sigo aprendiendo, en lo personal me dedico más a las consultas porque armar tablas no es algo complicado si dominas conceptos básicos, no voy a entrar en temas de cuando conviene cierto tipo de caracteres u valores para las tablas porque eso depende de la necesidad del momento.
Para este ejercicio cree una simple tabla con dos campos el nombre del país y su población.

You can learn many things in SQL, it is a programming language with many years in the development world and has reached very efficient levels for working with data, achieving efficient and filtered queries in the ways that are necessary for the work. I am still a newbie and I am still learning, personally I dedicate myself more to queries because putting together tables is not complicated if you master basic concepts, I am not going to go into issues of when certain types of characters or values ​​are appropriate for tables because that depends on the need of the moment. For this exercise create a simple table with two fields the name of the country and its population.

order1.jpg
En este ejemplo muestro como se pueden ordenar los datos de la consulta con comandos sencillos “ASC / DESC”, ascendente y descendente. Muchos de los que ya dominan SQL conocen estas cláusulas para las consultas, pero lo que más me encanta de SQL es que puede limitar la consulta a los valores deseados.

In this example I show how the query data can be sorted with simple “ASC / DESC” commands, ascending and descending. Many of you who are already proficient in SQL know these clauses for queries, but what I love most about SQL is that you can limit the query to the desired values.

order2.jpg


order3.jpg
Con SQL puede limitar las filas que retornara la consulta con el método LIMIT y además puedes indicar desde que índice de resultado debe retornar el resultado de la consulta con OFFSET, en el cual debes tener en cuenta que el primer valor empieza con el índice 0 al igual que los Array.

With SQL you can limit the rows that the query will return with the LIMIT method and you can also indicate from which result index the result of the query should be returned with OFFSET, in which you must take into account that the first value starts with index 0 at the end. just like the Array.
![order4.jpg]()


0
0
0.000
2 comments
avatar

Congratulations @dobro2020! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 30000 upvotes.
Your next target is to reach 35000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Our Hive Power Delegations to the September PUM Winners
Feedback from the October Hive Power Up Day
Hive Power Up Month Challenge - September 2023 Winners List
0
0
0.000
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000