Questions tagged as 'sql'

2
answers

Procedure to store in backup tables?

I have two tables, sales and salesProduct on account of the volume of information in these tables read / write operations are slow. I need to create a procedure that stores this data (from sales and sales tablesProduct), from a certain period, i...
asked by 23.11.2016 / 22:06
1
answer

Web form update help

I'm developing a CRUD system, and I'm having trouble updating registered users. The bad news is that my browser does not show any errors. The problem is that when I do edit in some field, for example, email, where it was written [email protected]. D...
asked by 24.11.2016 / 18:43
2
answers

You can save multiple values in a single bank field

I declare the field in the database like this: descricao VARCHAR2(5)not null, You can, for example, save 1 , 2 , 3 , 4 a single record) in the descricao field, where each of these values refers to a specific thing.     
asked by 16.10.2016 / 03:13
1
answer

Allow null value in relationship field

I have a MySQL database with tables t1 and t2 . One of the columns in the t1 table has a foreign key for t2 . You need to allow the foreign key column to accept null values. There are already important...
asked by 05.10.2016 / 20:44
1
answer

Create procedure to adjust price according to conditions (SQL Server) [closed]

In a DB of a bookstore I need to create a procedure to readjust the price column according to the percentage and gender reported (using transaction control). How should I do it? create table livro ( liv_ID int not null constraint PKcod_li...
asked by 26.10.2016 / 23:43
1
answer

Import data via SSIS or C #?

Hello I would like to know a more professional way to perform data import (TXT, CSV, XLSX and etc.) since today we do this via C # or by executing the SQL "Bulk Insert" command. If I should use SSIS or some other more efficient way of impo...
asked by 16.09.2016 / 16:34
1
answer

Get elements of a dependent column from another [duplicate]

I have to make a Table that indicates the "name2", "local" and "name" of the animals in greater number in each "name". SELECT DISTINCT OP.nome , OP.localizacao , AD.nome_cientifico FROM C AD , A OP, B CP WHERE OP.id_aquario = CP.id_aquar...
asked by 01.12.2016 / 20:12
1
answer

Doubts with "pivot" ORACLE

I would like to know how I can put the fields CODE_PROCESSO, PRODUCT_NAME, and APPROVED_USO in the main select to show in my query SELECT CODIGO_PROCESSO, MAX (DECODE (tipo_arquivo, 'BT', caminho_arquivo)) ArquivoBT, MAX (DECODE (tipo_arquivo...
asked by 02.12.2016 / 15:46
1
answer

Get the largest elements of a SQL column

I have 3 tables and I have the following question to solve: "Get the" name "with the highest" perce "related to" num2. "Enter" num2 "through" Name2 " -- A (name,Num2, local) insert into A values ('Favela',1,'WE'); insert into A values...
asked by 01.12.2016 / 00:45
2
answers

How to do this consultation with JPA?

I would like two solutions to this question, one using a normal typedquery and another using the criteria because of its great versatility for the code. Here is my query: TypedQuery<Pessoa> query = em.createQuery("SELECT a FROM...
asked by 18.08.2016 / 15:26