Manejando datos

Common_schema: repetitive tasks with foreach

Posted by in MariaDB, MySQL

Although we have spoken several times of this framework MariaDB MySQL-today a new feature, I bring very useful when you need to perform repetitive tasks based on consultations. It is used foreach call. Here I present a practical example of how you’ve used to perform a specific task: to replace all null to zero in a table with a lot of fields values. Locating the table fields The best way of locating the fields that will be used in our task is by using the information_schema, an internal database needed…read more

The mecanism of indexing on MySQL-MariaDB

Posted by in Databases, MariaDB, MySQL

In previous entrance related to MySQL and MariaDB I wrote one entrance related to why indexing is important, when working with databases (the article is only in spanish, but I will translate into english), and later, how to force MySQL-MariaDB to use a specific index that it is not the one chosen by MySQL (also in spanish). Today’s entrance is related to explain how works the mechanism of an index on MySQL-MariaDB tables, and what important considerations you need in order to get the best performance, and optimize your queries!…read more

Faster method: TRUNCATE or DROP a table?

Posted by in Databases, MariaDB, MySQL

I am working a a project in the University and I need to re-create a table. For that task, I’m thinking in two ways: using TRUNCATE, or dropping the table and create it again. TRUNCATE is a SQL sentence that empties a table, and for using it, you need to be granted as using DROP priviledge. autokey is reset to zero. The second option is using DROP a table, and create it again using CREATE TABLE. Para valorar de las dos opciones es más rápida, vamos a utilizar PROFILE, para…read more

Learning #MySQL at SoyData.Net

Posted by in Databases, MariaDB, MySQL

This entrance is dedicated to a new website for learning #BigData in spanish: What is It is a collaborative online training platform on all matters relating to data in spanish. It now has 15 fully uploaded and available courses to which they have registered more than five hundred people in just two weeks. These courses address specific high demand technologies like Hadoop, MongoDB, R and cover key areas such as visualization, cloud computing or Structured Query Language (SQL). It also provides an introduction to #BigData concept for those…read more

Export large datasets from MySQL using Python

Posted by in MariaDB, MySQL, Python

In the entrance about export large datasets we’ll see several ways of doing it, and now it is time to see how to do it with Python. Conecting to MySQL from Python Before continue, you could read here how to  conect to MySQL from Python, where you also use a class I use to connect because this class does what I like. But for this entrance, I will conect directly to MySQL by using the library PyMySQL. You only need to import the library, set the correct informacion for the…read more