Questions tagged as 'mysql'

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
2
answers

Is it really necessary to create a 3rd auxiliary table in N-N relationships?

In several places I see that when you have a N - N relationship (if memory does not crash) it is recommended to create a 3rd helper table and then later it will be transformed into a 1 - 1 relationship ( also if memory does not fai...
asked by 17.07.2017 / 16:44
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
3
answers

What are the appropriate data types for columns like address, email, phone, and mobile for SQL database?

What kind of data is recommended to create the following fields: address, email, cell / phone number?     
asked by 04.02.2014 / 20:13
3
answers

What is the difference between the LOCATE and INSTR functions?

The description of the function LOCATE , in free translation, is: Returns the position of the first occurrence of substring. The description of the function INSTR , in free translation, is: Returns the index of the first occurrenc...
asked by 18.05.2017 / 20:29
2
answers

MySQL = MariaDB?

For some days I've been teaching the teacher saying:    Oracle bought MySQL and just renamed it to MariaDB . As I am not easy to believe in the things spoken, I went to research on the subject and for the little that I read,...
asked by 21.02.2018 / 13:28
2
answers

Close connection to database C #

I am making a login system and I get the exception sql message when I try to create a new account in the database: MySqlCommand usuaExiste = new MySqlCommand( "SELECT * FROM contas WHERE nome = '"+textBox1.Text+"'", bdConn); bool resultado...
asked by 21.02.2014 / 20:45
1
answer

How do I SELECT on 2 or more Tables with 2 or more conditions?

I have a problem making a select with the following conditions: I want to display the data with either condition1 or condition2 Select * tabela inner join tabela2 WHERE campo = 0 and campo2 = '' and campo3 or campo10 is NULL Select all the...
asked by 11.03.2014 / 11:14
3
answers

SQL command to display specific records of the "id" field

What SQL statement would display the records where the id field was 22, 23, 25 and 27?     
asked by 30.08.2014 / 02:21
5
answers

How to display the result of a query in a html page in PHP?

How can I display the results of a query in a one-page html table? Below is what I was able to do. However, the code only shows the first record. include("conectar.php"); $sql = mysql_query("Select * From tb_trabalhador and tb_detalhe_traba...
asked by 31.01.2014 / 17:53