MySQL: O Tipo de Dados JSON e o NoSQL

JSON é uma maneira prática, em formato texto plano, de trocar dados, independente, de linguagem de programação ou plataforma. JSON é como se fosse um arquivo CSV com esteróides, ou, um XML mais compacto. De tempos em tempos, surge uma evolução de arquivos, protocolos, ou, formas de troca de dados. JSON é uma dessas evoluções.

O que significa JSON? Javascript Object Notation… Hum… se tem java no nome… Disse uma vez um monge tibetano que: “Java é a melhor forma de se criar uma aplicação que rode em qualquer plataforma, de forma mais lenta e com mais travamentos”. Sou técnico, e, não filósofo. Mas, o fato é que JSON (Djei Zon) já ganhou adeptos, e, é uma das formas de troca de dados entre aplicações, servidores, plataformas, etc. Portanto, merece um tipo de dados exclusive. Continue lendo MySQL: O Tipo de Dados JSON e o NoSQL

What are literals in MySQL?

If we look in the dictionary: literals are meanings. Description of something in the form of text. In MySQL, Oracle, SQL Server, or any other database, a literal is the content of a variable, or simply a value offered for comparison.

SET var_Name = ‘ALEXANDRE’

In the example above we’ve assigned the literal ALEXANDRE to the var_Name variable. We can say that the content (or meaning) of var_Name is ALEXANDRE.

Ah! Got it!!! Everything between quotes is a literal. Not so fast. The analogy is good but imperfect.

SET var_I_like_move_move_it  = FALSE;

SET @var_Price = 10;

SET @Qty = 3;

SET @Total = @var_Price * @Qty;

FALSE (0) is a literal that has been assigned to var_I_like_move_move_it.  Although my children love Madagascar, and, I being sympathetic to King Julien, I don’t like to dance. Therefore, FALSE (0 in MySQL) describes the contents of the variable to which it was assigned.

10 is the literal assigned to the integer variable @var_Price. Like, 3 tells me how much the @Qty variable is worth. The computation (calculation) of the literals contained in the environment variables @Var_Price and @Qty describe the environment variable @Total, or the value within the variable. Continue lendo What are literals in MySQL?

O que são literais no MySQL?

Se buscarmos no dicionário: literais são significados. Descrição de algo, na forma de texto. No MySQL, Oracle, SQL Server, ou qualquer outro banco de dados, uma literal é o conteúdo de uma variável, ou, simplesmente, um valor oferecido para uma comparação.

SET var_Nome = ‘ALEXANDRE’

No exemplo acima estamos atribuído a literal ALEXANDRE à variável var_Nome. Podemos dizer que o conteúdo (ou significado) de var_Nome é ALEXANDRE.

Ah! Entendi!!! Tudo que está entre aspas é uma literal. Não tão rápido. A analogia é boa, mas, imperfeita.

SET var_Eu_Remexo_Muito = FALSE;

SET @var_Preco = 10;

SET @Qtde = 3;

SET @Total = @var_Preco * @Qtde;

FALSE (0) é uma literal que foi atribuída à var_Eu_Remexo_Muito . Apesar de meus filhos adorarem Madagascar, e, eu ser simpatico ao Rei Julian, eu não gosto de dançar. Logo, FALSE ( 0 no MySQL) descreve o conteúdo da variável à qual foi atribuída.

Continue lendo O que são literais no MySQL?