Questions tagged as 'sql'

1
answer

Query Doubt - Group Data

I have a question about how to group the data as follows. I have a table named ALUNO_LEGADO , as below: I need to assemble a query to catch all the students who failed in all the subjects enrolled in a given year. Eg: Select student...
asked by 12.10.2015 / 17:48
2
answers

Get oldest value from another table

I need to create a query that returns the oldest stock of each product within a specified period: Tabela Produtos: ID DESCRICAO 1 TOMATE 2 ABACAXI Tabela Estoque: DATA HORA PRODUTO ESTOQUE 01/01/2015 09:01:00 1 8 01/01/...
asked by 12.10.2015 / 05:58
1
answer

Create trigger MySql increment / decrement attribute

I have the following tables -> app(id_app, nome_app) -> category(id_category, nome_category, total_apps) -> app_category(id_app_fk, id_category_fk) What I want to do is that whenever I add data to the table "app_category" it checks...
asked by 05.08.2015 / 02:49
1
answer

STORED PROCEDURE

I have 2 procedures and I wanted to call the procedure sp_is_temporada in the procedure sp_calcula_curso , and the value that the procedure sp_is_temporada return will be used in procecure sp_calcula_curso , and the arg...
asked by 10.09.2015 / 15:38
2
answers

Sort result using CASE and BETWEEN

In the first code just below, I can list right the freight price of the transports table via the range of cep and peso , however I'm having a problem, I need to sort the result according to zip sent, depending on the query is fallin...
asked by 22.07.2015 / 04:32
1
answer

Create a dictionary in Python receiving values from the database

After accessing the database and having the desired query in case: ... c = conn.cursor() c.execute('SELECT 'tb1'.'Nome', 'tb1'.'Apelido' FROM tb1') How do I create a python dictionary for my above command? dict = {Nome:'Apelido'} ... ?...
asked by 10.07.2015 / 20:19
1
answer

Automated Deploy - Version Maintenance for Multiple Clients

What is the best way to automate deploy? Having 1 deploy for each client, what is the easiest way to keep all of these deploys? database migrations and all version handling? In an example we have 100 clients     
asked by 09.09.2015 / 02:40
1
answer

ListView of the Android database - Close app with error

I'm implementing a SQLite3 registry on Android and so far so good, the problem is in calling Activity of data listing when the registration is successful, when calling Activity the application is closed with error. Follow the co...
asked by 19.06.2015 / 19:08
1
answer

Select subcategory by category

Having the following tables in the category and subcategory database: CREATE TABLE categories ( id INT AUTO_INCREMENT PRIMARY KEY, category_name VARCHAR(255) NOT NULL, created DATETIME, modified DATETIME ); CREATE TABLE sub_categories...
asked by 27.07.2015 / 19:31
1
answer

Concatenation of a Select field in the ADDTIME

"SELECT at.codigoTurma, " "ADDTIME(t.horaInicioCurso, '00:01:00'), " "t.toleranciaCurso, " "t.horaFinalCurso " "FROM AlunosTurmas at " "INNER JOIN Turmas t " "ON t.codigoTurma = at.codigoTurma "...
asked by 27.07.2015 / 19:10