Questions tagged as 'mysql'

1
answer

Calculate average length of service

Well, I need to take the average number of calls and I have the following data: 00:12:35 00:05:10 00:01:42 00:08:12 00:01:01 {...} The question is, how can I do it? I searched for a way to do this using Mysql's AVG but I did not succeed ......
asked by 17.01.2018 / 19:37
2
answers

Relationship of 1 attribute with different tables

Hello, good afternoon. I'm modeling my database (MySQL) and a question has arisen. In the bank, among others, I have the following tables: Officials - Sectors - Branches An Employee works OR in a Headquarters Sector OR in a Branch. I wan...
asked by 18.01.2018 / 19:09
3
answers

Display products from various categories

This is my first post, I've been trying to solve a problem for some time now, but without success. I have the CATEGORIES table and the PRODUCTS table I need to display the following way: CATEGORY 1 - Produto 1 - Produto 2 CATEGORY...
asked by 23.04.2018 / 22:17
1
answer

Search in DB with For Repetition

I have the following table as an example: data - chave primaria, contendo a data mesmo 2018-01-02. diasemana - int, contendo o dias das semana tipo 1 para segunda, 2 para terça. semanaAno - int, contendo o numero de semana do ano tipo 1 primei...
asked by 01.01.2018 / 23:45
2
answers

How to do INNER JOIN mysql

How do I do an inner join in these tables: Vehicle vei_id vei_name vei_cor mar_id (foreign key) Brand mar_id mar_name I want to pull in a table vei_name, vei_cor and mar_name     
asked by 27.01.2018 / 14:26
1
answer

Get INT as INT and not as string - Codeigniter - Ajax

I have the following tabela , controller and model , I want to get what is int as int , not string . Note that when the item is retrieved, the int field is enclosed in quotation marks. How do I rec...
asked by 19.12.2017 / 19:08
1
answer

Sql Injection in Stored Procedures

SQL injection in Stored Procedures , especially when calling a Procedure by PDO of PHP ? DELIMITER // CREATE PROCEDURE procedureTeste( string VARCHAR(255) ) BEGIN SELECT * FROM produtos WHERE nome = string; END // DELIMITER ;...
asked by 01.03.2018 / 01:12
1
answer

Relate 4 bank tables and perform accounts

Hello I have 4 tables: Officials, Companies, Salaries and Discounts. I would like to introduce a kind of Holerite. My initial idea was to bring all the information together and treat the view as follows: (NOTE: I'm using laravel blade) @for...
asked by 04.01.2018 / 00:55
1
answer

Best way to generate Holerite, I look for a more viable solution

I developed an application that generates Holerites, and for that I need to treat data coming from 4 tables.    Officials - > Companies - > Maturities - > Discounts I want to show my user this way for example:    Rafael works...
asked by 04.01.2018 / 19:45
1
answer

PHP, marking checkbox for printing

I have the following situation, and would like to know if you can help me. I have a page where I mark the checkbox and send it to the print page. But I am not able to loop , so the code can see every id at a time, and generat...
asked by 02.12.2017 / 15:32