Questions tagged as 'sql'

2
answers

Problem with mysql and php

I have the following doubt, I am doing a search engine, that I look for in my database a product that contains some letter in its name, I make the query in phpmyadmin and all good, it works for me, the problem comes when I pass by parameter from...
asked by 09.09.2018 / 07:47
1
answer

As an addition to a 2 foreign key that are both primary?

My problem is as follows, I have 2 COORDINATION and NACCLE_ACADEMIC tables, the relationship between them is N: M (many to many), the structure of the table COORDINATION and NACCLEO_ACADÉMICO the table is as follows: CREATE TABLE coord...
asked by 19.09.2018 / 04:09
1
answer

How to create sequences in MariaDB Server?

Within database managers as they are: Oracle PostgreSQL SQL Server We have the possibility to create sequences, which help us for example to generate the incremental auto key that distinguishes each of the records of a table in a data...
asked by 18.09.2018 / 01:33
1
answer

SQL query Advanced filter with Postgres

I have this database model I want to make a query that meets the following conditions. all students must be listed I want to be able to see the type of characterization only of the characterization with the highest order semester...
asked by 20.11.2018 / 06:31
1
answer

how to know how many records a query returns sql server 2012 with php

I have the following query SELECT * FROM REPORTE and I want to know how I do to count how many records are in the table, in SQL Server 2012. With php I can not find how to perform certain functions based on the number of records.     
asked by 23.08.2018 / 00:48
1
answer

Count records of three SQL server tables

I have the following: Tabla1: "CAT_SEXO" Campos: SEXO_ID/SEXO Tabla2: "CONDUCTORES" Campos: sexo_id Tabla3: "LICENCIAS" Campos: fecha_captura for mentioning the data of interest for my question. The point is that I need to consult the n...
asked by 23.08.2018 / 01:25
1
answer

Bring related data from a table

I have 2 tables a types and the other plates which are the following: But I want to bring the type of that plate, how would I do it? example: I have a plate with id 1 and it has the id_type 2 , and I want t...
asked by 30.09.2018 / 20:03
2
answers

Find duplicate records, change them and return them only in MySQL

I have a problem, I have data from a table that is duplicated, inside are the following fields id, empresa, actividad, compañia I need the field empresa is unique, I generate a query to know how many and which are duplicates and I...
asked by 28.09.2018 / 16:59
1
answer

Like statement with parameters

I have the following procedure: create procedure buscar( in producto) begin select nombre from producto where nombre like'%'+producto+'%' end but I get an error in the like try using create procedure buscar( in producto) b...
asked by 27.06.2018 / 12:43
1
answer

Select with empty fields when you can not find

Assuming I have these two tables with the following records cliente id nombre 1 c1 2 c2 3 c3 4 c4 5 c5 tabla2 id_cli dato 1 d1 3 d3 10 d10 If this selection is made it shows us the...
asked by 12.05.2017 / 13:44