Questions tagged as 'sql'

3
answers

Pre-process large text files in R

I am writing a script, which I will make public, to open the RAIS microdata (unidentified, available here ) in R using MonetDB. However, the bank does not accept a vignette (,) as a decimal separator. Each RAF UFano.txt file is quite large (up...
asked by 09.10.2014 / 22:52
1
answer

How to do SQL query that ignores uppercase, lowercase and accents?

I have a database with multiple movies, and would like to create a SQL query that ignores the presence of uppercase, lowercase, accents, and ç. For example when searching for "brave heart" I would like the query to return the record of the movie...
asked by 08.11.2015 / 04:16
4
answers

Why is this SQL statement incorrect?

SELECT * FROM produtos WHERE categoria = 'Vestidos' AND cor = 'Branco' OR cor = 'Rosa' Returned 3 records, 2 of them in the Dresses category and 1 in the Shoes category. Why did not you just return from the Dresses category since I inst...
asked by 24.04.2015 / 19:29
4
answers

MySql decimal value

I'm trying to insert decimal value into the mysql database, I wanted to put these values for example: 1.500,00 Thousands, hundreds and tens What kind of column should I declare?     
asked by 24.10.2014 / 01:44
1
answer

Sort Varchar field taking into account groups and subgroups

I need to sort the values below in ascending order. They are of type Varchar and the solutions I have found so far for MySQL did not work. An example of the data type would be 1.12.02 , as these values serve as specific code for a chart...
asked by 26.09.2016 / 19:38
1
answer

What is the advantage of using CHAR instead of VARCHAR?

What is the advantage of using CHAR instead of VARCHAR in database since the advantages of VARCHAR exceeds CHAR (if it has?). Is there a difference in the field size definition time since VARCHAR has a variable...
asked by 04.05.2015 / 14:13
1
answer

Comparison: CTE vs CURSOR

I do not know if this will be a question that many pose, but I have always had it in mind almost always. Normally when I need to deliver a corrective script to a client, used to only run once, I use a CURSOR , perhaps because it is mo...
asked by 24.12.2018 / 12:39
2
answers

Update with Case When you need to where?

UPDATE bethadba.FOFILHOS SET CPF = CASE WHEN CODI_EMP = 61 AND I_EMPREGADOS = 156 AND i_filhos = 1 THEN '00551366133' WHEN CODI_EMP = 57 AND I_EMPREGADOS = 290 AND i_filhos = 1 THEN '00636170993' WHEN CODI_EMP = 61 AND I_EMPREGADOS = 333...
asked by 11.06.2018 / 19:20
3
answers

Query on two tables without INNER JOIN

I wonder, is there a difference in the performance of these two queries? in MySql SELECT employee.*, company.name FROM company, employee WHERE employee.company_id = company.id AND company.id = '365' or SELECT employee.*, company.name F...
asked by 26.03.2014 / 19:43
4
answers

Should I use a "try-catch" to identify if a password is wrong?

In the login screen, I check the bank with select , and I'm using catch to catch this exception. Is it correct to use catch for this type? if (Usuario != string.Empty && Password != string.Empty) {...
asked by 21.07.2016 / 16:04