Questions tagged as 'mysql'

4
answers

The WHERE clause order interferes with performance?

Recently I did tests on a database with a query using two clauses where AND. I noticed that there was a significant difference using clause A before B and vice versa. Intuitively, it would be faster to use FIRST the more restrictive criterion...
asked by 22.12.2014 / 19:01
1
answer

How to enable explicit_defaults_for_timestamp?

I installed MySQL Server 5.6. When I try to connect the MySQL server running mysqld.exe, I get the following message: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (se...
asked by 24.08.2014 / 06:44
1
answer

Is it possible to execute a query (insert) and only then check if it is duplicate?

I am reading an XML file and at the same time I insert the records into the DB. My code looks like this: foreach($itens as $item) { ... if ( ! $stmt_insert_item->execute ( ) ) { if ( $this->mysqli->errno == ER_DUP_...
asked by 06.06.2014 / 16:04
1
answer

Query in mysql with hierarchy

I have a table called 'departments' with the following structure: CREATE TABLE 'departments' ( 'id' tinyint(255) NOT NULL AUTO_INCREMENT, 'company_id' tinyint(255) NOT NULL, 'name' varchar(255) NOT NULL, 'parent_id' bigint(20) DEFAULT...
asked by 08.07.2014 / 16:20
1
answer

Store Files

I have a question about uploading files, do I have to create folders for each client and save files from them (Word files, Excel, txt, dwg, dxf, ascii, pdf)? Would it be feasible to store all this for each client in an online directory or wou...
asked by 23.03.2014 / 19:33
1
answer

How to check SQL backup integrity

I'm using MySQL , and to back up the banks, I'm using mysqldump . My question is if and how can I check if the file generated by the dump is intact automatically, without having to "upload" the dump into the bank?     
asked by 28.08.2014 / 19:20
1
answer

Interpreting the MySQL Explain command

I have a query that is taking 6/8 seconds to execute. The database I'm using is MySQL. In PhpMyAdmin I did the following: EXPLAIN SELECT id_categoria, sc.categoria, categoria_principal, associada FROM get_produto_categoria gpc INNER JOI...
asked by 15.10.2014 / 13:21
2
answers

View "View" from Postgres in Mysql. It's possible? How to make?

Is there any way to view a View created in Postgres and view it in MySQL? If yes, how to configure?     
asked by 01.09.2014 / 20:26
1
answer

Questions about inserting this template

I'm developing an application that needs to have both an individual and a legal person, I would like help finding out what the insert of that model would look like If I want to register an individual, I should make two insert...
asked by 25.10.2016 / 12:15
2
answers

Return the highest value between columns and the ID for the line of this higher value

Let's say I have two columns in my table, column A and B. +-----+-----+-----+ | ID | A | B | +-----+-----+-----+ | 1 | 500 | 681 | +-----+-----+-----+ | 2 | 980 | 101 | +-----+-----+-----+ | 3 | 110 | 981 | +-----+-----+-----+ If...
asked by 12.11.2018 / 22:28