Questions tagged as 'mysql'

1
answer

UTF-8: reading and inserting into MySQL via Ruby 1.8

I'm using a Ruby script that parses an XML file and inserts the information into a MySQL database. It works perfectly fine, but it's giving me a headache now that my XML files have strings in Portuguese Detail: I'm completely new to Ruby....
asked by 02.07.2014 / 21:22
1
answer

Replication of database query with multiple FIND_IN_SET ()

I have the following query to find topics related by a set of ID's that are not the topic to be viewed: SELECT press.image, press_i18n.title, press_i18n.slug FROM press INNER JOIN press_i18n ON ( press.press_id = press_i18n.pre...
asked by 03.07.2014 / 03:16
1
answer

Best way to store images in a database

I have an android application that uses a mysql database, to store profile information for my users, but I would like to know how best to store each user's photos, as I thought of uploading the imgs when he took it out and save only the url, but...
asked by 24.07.2014 / 07:01
1
answer

Foreign key creation problem

I'm having trouble creating a foreign key of these tables: Code: ALTER TABLE 'tb_permissao_view' ADD CONSTRAINT 'fk_tb_permissao_view_tb_sistema_pagina' FOREIGN KEY ('cd_pagina') REFERENCES 'tb_sistema_pagina' ('cd_pagina'); Erro...
asked by 25.01.2016 / 21:11
1
answer

How do I use today's date as column heading in MySQL

I have the following table: Consideringthattodayis02/01/2019,whenmakingthepivottablebelow:SELECThora,CASEWHENdata=CURDATE()THENtarefaELSENULLENDAScampo_1FROMtabelaWHEREdataBETWEENCURDATE()ANDDATE_ADD(CURDATE(),INTERVAL2DAY)GROUPBYhora,dataOR...
asked by 03.01.2019 / 20:42
3
answers

Viewing Oracle database data via MySQL

I need to know how do I get the data from an Oracle database in my MySQL database, a kind of view . I do not want to do insert , update nor delete in the Oracle database, I only need%% of this data to have them in my MySQ...
asked by 18.12.2014 / 16:52
2
answers

Optimize MySQL query to remove FILESORT

I'm in the process of optimizing my queries from my web app. But as I do not have much experience I can not find a solution to remove the use of FILESORT. Does anyone have any idea what to do to stop this FILESORT? What indices to create? S...
asked by 06.01.2015 / 14:33
3
answers

Is it worth putting two foreign keys in a table?

having the tables: Companies Customers company_id: foreign key Sales client_id: foreign key where the relations are: Companies and Clients = > 1: N Customers and Sales = > 1: N Considering that I will need to...
asked by 24.07.2018 / 22:28
1
answer

Foreign keys in java

I'm having a bit of trouble implementing the foreign keys in my example. Can anyone help me mount the DAO class? CidadeDAO.java public class CidadeDAO { private final Connection connection; public CidadeDAO() { try {...
asked by 25.03.2015 / 13:17
1
answer

Merging function calculating wrongly

I'm trying to write a function in python that takes two vectors, deletes duplicates in the first and adds the corresponding data in the second. I mean trying to emulate the following MySQL query: SELECT 'Price', sum('Volume') FROM 'Dataset'...
asked by 19.03.2015 / 19:23