Questions tagged as 'sql'

1
answer

Problem counting all records by specialty and adding record with total

I need to extract the total of all records by specialty and, in turn, add this number of records. This is my SQL query: SELECT t.empresa, Count(t.idespecialidad) AS todos, e.nombre AS nombre_especialidad FROM...
asked by 11.05.2018 / 15:10
2
answers

problems when inserting in a bd

I have 2 tables in my database one of them is cards and the other type cards basically after normalizing the table cards I am left with a type fk that links to the card type pk, then insert data in this last one like this its structure more down...
asked by 30.07.2018 / 05:37
1
answer

How to remove the subquery in creating a MySQL view

I have this query in MySQL Select t.grupo, Sum(servicios.cantidad) As total From (select distinct clv_servicio, grupo from actuacion) as t Join servicios On t.clv_servicio = servicios.id_servicos Group By t.grupo That works correctly but...
asked by 04.05.2016 / 22:44
2
answers

Can I use a SQL Server database in my RAILS 4 project on ubuntu?

I want to develop a website in RAILS 4 but I must necessarily use an existing database of SQL Server, is it possible to use it in ubuntu or do I have to program in Windows?     
asked by 19.06.2016 / 07:54
1
answer

queries with sql server 2016

the statement is following: get the name and ID of the students with the highest grade in the subject with the code 46322 The structure of the database is this: alumnos (dni pk, nombre, dirección, localidad) asignaturas (coda pk, nombreas,...
asked by 19.06.2016 / 19:37
1
answer

convert a saved image to byte in an itextsharp image to display in PDF C #

I need to convert a saved image into a byte in the database (SQL) to be able to print it to a pdf with itextsharp In this code I call the method where the byte of the database is consulted. string imgByte = obtenerByteImagen (codigo, codigo...
asked by 31.01.2018 / 18:54
3
answers

Advanced search and mysql query

Good morning, I have a problem when it comes to making a query, since it does not return the desired result. The conditions for the consultations are marked by the user with a form similar to this one: And this is the scheme of the tabl...
asked by 17.05.2017 / 11:42
2
answers

How to add columns from values in a row?

I need to make an application that allows me to keep track of the results of Fishing and Hunting Competitions. For this problem I designed the following database: I must generate the following table: it is not possible to distingui...
asked by 05.01.2018 / 20:35
3
answers

mysql: fields and count (*) of union

Following the query I made a few days ago ( mysql pivoting table result of fields json ) I have found another problem. It turns out that I have to obtain several fields of union and divide it by the total number of elements that the union has....
asked by 29.12.2016 / 11:40
1
answer

Normalize monthly installment payments

I am working on a system to control monthly payments (similar to a tuition payment system), and I am concerned about standardization. For example: Table quotas Id_abonado id_recibo año mes valorcuota pagado 12 1...
asked by 29.09.2016 / 03:21