SQL, mis primeros pasos [esp] [eng]

VERSIÓN EN ESPAÑOL

English Version


learning_database.jpg
source

Como lo comentaba en mi último post de programación, estoy en estos momentos estudiando y comprendiendo el lenguaje de base de datos que usamos para guardar y consultar esa información que de manera particular debe nutrir nuestro proyecto. Particularmente he elegido comenzado por SQL que por sus siglas en inglés significa Structured query lenguaje" esto es lenguaje de consulta estructurada, puesto que existe un conjunto de lenguajes que hacen esto mismo, pero siguiendo otros parámetros, en general se conocen como lenguajes no-sql, aunque pueden usar algo del mismo por detrás.

Quisiera recomendar, ya que en post previos me lo han pedido, un recurso que me ha servido de manera especial, sobre todo porque imprime esa motivación extra que en muchas ocasiones se necesita en este mundo del desarrollo. Es un video de YouTube, al cual puedes acceder aquí, hago la acotación además que el youtuber tiene otros cursos del mismo estilo, que me han ayudado en mis primeros acercamientos a la programación.

Conceptos básicos

Algo que es muy importante tener en cuenta al comenzar en cualquier lenguaje es que, al final, todos tienen una base común, de tal manera que aunque puedan variar en su aplicación técnica los conceptos que le fundamentan permanecen inalterables, por eso, comparto mi comprensión de los elementos básicos a tener en cuenta en todo lenguaje de consulta de base de datos, como lo que es SQL.

En primer lugar, tenemos la entidad, esto es todo aquello que tiene vida propia, cualquier registro (objeto, persona, hecho, etc.) que precise realizar en una base de datos y que pueda existir independientemente a cualquier otro. Por ello, se diferencia de los atributos, que es todo lo que podemos decir de una entidad. Así si tenemos un registro de una persona de nombre fulano, esta es la entidad, lo que decimos de ella, como por ejemplo la fecha de ingreso a una empresa y cargo que ocupa, sería parte de sus atributos.

Un tercer concepto unido a los dos anteriores es el de relación, sobre todo en base de datos relacionales, como lo es SQL, ya que con el mismo nos referimos a la unión que podemos encontrar en dos entidades diversas. Por ejemplo, si establecimos que fulano tiene el cargo de gerente de ventas podemos relacionarlo con otra entidad que se llame gerencias, la cual a su vez tenga un registro de los demás gerentes de la misma, entre otras muchas cosas más, pues lo que buscamos al consultar datos es tener la oportunidad de procesarlos y obtener una determinada información.

Herramientas para la aplicación de conceptos

Otra cosa a tener en cuenta en la programación es que muchos conceptos no los terminaremos de comprender sino hasta que los pongamos en práctica, por ello, quisiera terminar indicando algunas de las herramientas para irnos adentrando en este lenguaje. Las dos primeras son de carácter todavía un poco teórico, sin embargo, no dejan de ser eficaces.

  • Diagramas ER. Son parecidos a los mapas conceptuales que aprendimos en la escuela, con la diferencia que aquí no buscamos establecer conceptos, sino las relaciones entre las entidades y los atributos, útil para tener una primera visión gráfica del diseño de una base de datos.

  • Diagrama físico. Es un gráfico más complejo porque se presentan las tablas (conjunto de entidades) con los datos más específicos, como, su tipo (texto, número, fecha, booleano, etc.) y algunas particularidades del mismo (valor default, unicidad, entre otras), además de que la relación también se expresa de manera más concreta con lo que se llama cardinalidad que no es más que especificar cuántos atributos de cada entidad tiene relación con otras entidades, de allí nacen las relaciones 1:1 (relación por un atributo) o 1:n (relación desde un atributo a muchos más), que son los casos más comunes.

  • RDBMS. Por sus siglas en inglés esto significa Relational DataBase Managment System, esto es, sistema de administración de bases de datos relacionales, es decir, las interfaces - gráficas o por terminal- que nos ayudan a comunicarnos con las bases de datos mediante el lenguaje estándar SQL. Entre ellas están: Sqlite, MySQL, PostgreSQL, MycrosoftSQL, entre otras. A excepción de la última, todas las demás son open source. Con algunas de ellas es que podemos empezar a poner en práctica lo que aprendamos a través del estudio de SQL, lo cual espero poder empezar a compartir en siguientes posts.



separador 4.png

ENGLISH VERSION

Versión en español


learning_database.jpg
source

As I commented in my last post of programming, I am in these moments studying and understanding the database language that we use to store and to consult that information that in a particular way must nourish our project. Particularly I have chosen to start with SQL, which stands for Structured query language " that is structured query language, since there is a set of languages that do the same, but following other parameters, in general they are known as non-sql languages, although they can use some of the same behind.

I would like to recommend, since in previous posts I have been asked for it, a resource that has served me in a special way, especially because it provides that extra motivation that is often needed in this world of development. It is a YouTube video, which you can access here, I also note that the youtuber has other courses of the same style, which have helped me in my first approaches to programming.

Basic concepts

Something that is very important to keep in mind when starting in any language is that, in the end, all have a common base, so that although they may vary in their technical application, the concepts that underlie it remain unchanged, so I share my understanding of the basic elements to consider in any database query language, such as SQL.

First of all, we have the entity, that is anything that has a life of its own, any record (object, person, fact, etc.) that needs to be made in a database and that can exist independently of any other. Therefore, it differs from attributes, which is everything we can say about an entity. So if we have a record of a person with the name fulano, this is the entity, what we say about it, as for example the date of entry to a company and the position that it occupies, would be part of its attributes.

A third concept linked to the two previous ones is that of relationship, especially in relational databases, such as SQL, since with it we refer to the union that we can find in two different entities. For example, if we established that fulano has the position of sales manager, we can relate it to another entity called management, which in turn has a record of the other managers of the same, among many other things, because what we are looking for when consulting data is to have the opportunity to process them and obtain certain information.

Tools for the application of concepts

Another thing to keep in mind in programming is that we will not finish understanding many concepts until we put them into practice, therefore, I would like to finish by indicating some of the tools to go into this language. The first two are still a bit theoretical, however, they are still effective.

  • ER diagrams. They are similar to the concept maps that we learned in school, with the difference that here we do not seek to establish concepts, but the relationships between entities and attributes, useful to have a first graphical view of the design of a database.

  • Physical diagram. It is a more complex graphic because it presents the tables (set of entities) with more specific data, such as its type (text, number, date, Boolean, etc.) and some particularities of it (text, number, date, Boolean, etc.).) and some particularities of the same (default value, uniqueness, among others), besides that the relation is also expressed in a more concrete way with what is called cardinality that is not more than specifying how many attributes of each entity has relation with other entities, from there are born the relations 1:1 (relation by an attribute) or 1:n (relation from an attribute to many more), which are the most common cases.

  • RDBMS. This stands for Relational DataBase Managment System, that is, relational database management system, that is, the interfaces - graphical or by terminal - that help us to communicate with the databases by means of the standard SQL language. Among them are: Sqlite, MySQL, PostgreSQL, MycrosoftSQL, among others. With the exception of the last one, all the others are open source. With some of them is that we can begin to put into practice what we learn through the study of SQL, which I hope to start sharing in the following posts.

separador 4.png

footer personal.gif



humanitascover2.jpg




0
0
0.000
1 comments
avatar

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

You have been a buzzy bee and published a post every day of the week.

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:

Women's World Cup Contest - Round of 16 - Recap of Day 2
Women's World Cup Contest - Round of 16 - Recap of Day 1
Women's World Cup Contest - Recap of day 15
0
0
0.000