Questions tagged as 'sql'

1
answer

take query sql [duplicated]

Hello, good morning and I look forward to your help. I need to get out of the table restaurant: , from the table user: and the user_type table all those restaurants that do not belong to a user type of id = 1 (owne...
asked by 20.05.2017 / 20:15
1
answer

Syntax to remove the privilege of a user from a stored procedure?

On the MySQL command line I gave a user permission to access a stored procedure (Stored procedure) with the following syntax: GRANT EXECUTE ON PROCEDURE Acervo_bibliografico.InsertarDatoUsuario TO 'Brandon_Padilla'@'localhost';...
asked by 21.05.2017 / 00:18
1
answer

Take out an sql query from the following tables [duplicated]

Hello, good morning and I look forward to your help. I need to get out of the table restaurant: , from the table user: and the user_type table all those restaurants that do not belong to a user type of id = 1 (owne...
asked by 20.05.2017 / 17:52
3
answers

Create in MySQL Database a Table State_Vehicle

I am doing a program for the administration of services of an auto mechanic workshop, in the there are tables like: Users, Clients, Staff, Services, Appointments, Vehicles and VEHICLE STATUS and a ternary table that could be called ServantServic...
asked by 18.05.2017 / 02:25
1
answer

Update of a field with the result of a select that returns several PL SQL records

My query is as follows: I must make a query that adds the prices grouped by several concepts, then, insert those results in the totals column, only when the quantity is different from 0. It would be like this: Precio Departamento Uni...
asked by 19.05.2017 / 15:07
1
answer

Add columns with the SUM SQL function, perform the sum but at twice the expected value

Hello I have the following sentence, the bad thing is that I'm adding the double, for example to execute it throws me the following values: 1 | test | x | x | 168 | 92 | 2 | 8 I should be returning something like that 1 | test | x |...
asked by 01.06.2017 / 03:43
2
answers

Select more than one column as null

I have the following query in SQL SERVER: Select Column1, Column2, Column3 FROM DBO.DATA as a result the following: COLUMN1 COLUMN2 COLUMN3 A Q P B NULL O NULL R L C T...
asked by 22.05.2017 / 17:39
1
answer

How do I return a 0 on the DNI and call it the anonymous block?

GETS_ALUMNO : function that returns the student's data from his ID (if it does not exist, he must return value 0 in the ID). CREATE OR REPLACE FUNCTION OBTIENE_ALUMNO (V_DNI IN ALUMNOS.DNI%TYPE) RETURN ALUMNOS%ROWTYPE IS V_ALUMNO ALUMNOS%...
asked by 28.05.2017 / 17:23
1
answer

Can I use STATEMENT with references like PREPAREDSTATEMENT?

With PREPAREDSTATEMENT the references of the values are passed to the QUERY but will there be any way to do it with STATEMENT ? With prepared statement I do it this way: String sql = "SELECT * FROM alumons WHERE nombre =...
asked by 28.05.2017 / 16:57
1
answer

How to create a trigger so that it does not erase a record if it contains certain characteristics in sql server

That is, create a trigger that prevents me from deleting a record from the 'person' table, but only if the name contains the following characters: 'JUAN' and print the message that can not be deleted CREATE TRIGGER borrar ON PERSONA INSTEAD OF...
asked by 16.05.2017 / 18:54