Questions tagged as 'mariadb'

2
answers

Condition for INSERT INTO

I need SQL to check if there is any value equal to 1, 2 or 3 in the '@variavel' sent; If it is green enter the value 1, otherwise enter the value 0. Note: the table and column can be given as example as fictitious.     
asked by 24.10.2018 / 14:16
1
answer

Insert in the table if there is no

How to insert data into a table only if it does not exist? the following attempt returns an error, the basic idea is to insert a unique mode record, if it already exists ignore, otherwise insert the record. INSERT INTO registro_tb (nome, tag)...
asked by 17.10.2016 / 07:05
2
answers

How to automatically add two columns from two different tables and perform insert into another table in MySQL?

I'm starting the database work and would like to do some smart action on the database. I have two tables that hold different sensor information, each with its own columns. I would like to get a column of each table (of my choice) and perfo...
asked by 01.05.2018 / 05:07
0
answers

Engine with less RAM than InnoDB / XtraDB in MariaDB?

InnoDB allows you to make multiple INSERT and also UPDATE without creating LOCKING , while in MyISAM it is not possible to make multiple INSERTs at the same time and to make matters worse MyISAM does not support TRANSACTIO...
asked by 13.01.2017 / 22:31
1
answer

How to import a csv file into MySQL?

I'm starting my studies in MySQL. I decided to install MariaDB 10.1.14 on CentOS. I want to create a database from a .csv file with approximately 166 million rows. I searched for tutorials on the internet, but it seems they all assume that the u...
asked by 20.07.2016 / 20:46
2
answers

Error with SQL and MariaDB (Current position is before the first row)

I have a problem with my database and I have no idea what it is. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res = connection.createStatement().executeQuery("select permission fr...
asked by 06.01.2018 / 08:25
1
answer

Select to List data from another table

I have a system from which I register the personal data enc_dados_pessoais and another table that stores complementary data enc_dados_complementares . In the personal data table, the user registers only the basic information and...
asked by 15.06.2015 / 16:49
1
answer

Duplicate record in database with new id

I have a table in the database called user, with n fields, how can I duplicate a certain record only with a new id? insert into usuarios * select * from usuarios where id = x? obs: this id is a non-null primary key     
asked by 18.07.2017 / 03:02
1
answer

Use specific data types like SMALLINT and MEDIUMINT instead of INT and mark columns with UNSIGNED is an exaggeration?

Speaking of databases, we know that they have several data types to use in each specific situation. But, following the data types to the letter can be considered an exaggeration in most cases or is it always recommended, even giving more work to...
asked by 05.06.2017 / 02:29
1
answer

Insert in MariaDB giving timeout

What reasons would it take for the simple insert described below to take so long that it even timeout the server? INSERT INTO wkvmk_postmeta (post_id, meta_key, meta_value) VALUES(904, '_order_key', '') Table structure: +------------+----...
asked by 28.11.2017 / 14:55