Questions tagged as 'sql'

1
answer

Join table columns where id equals variable

I have 4 tables they already have foreign key. aluno: id matricula username curso_id // referencia a id_cursos da tabela cursos, coluna id_cursos. cursos: id_cursos nome_cursos modulos: id_modulos nome_modulos cursos_id...
asked by 04.11.2017 / 17:15
1
answer

How to join with multiple tables?

I have 4 tables they already have foreign key. aluno: id matricula username curso_id // referencia a id_cursos da tabela cursos, coluna id_cursos. cursos: id_cursos nome_cursos modulos: id_modulos nome_modulos cursos_id...
asked by 04.11.2017 / 18:49
3
answers

Doubt - Update SQL Server 2012

When the update below is run for the first time, the field exits correctly the way I want it as below, but if I run it again, it comes out that way. What I want is that regardless of how many times the script runs, do not duplicate the month or...
asked by 16.10.2017 / 16:07
1
answer

PostgreSQL / VisualStudio database modeling

Hello. I have this form: Asforthemodelingofthebankthereinthe"products" part, I intend to load all products (name, quantity available, unit value) and when the person select some and put the quantity will calculate the total. My question...
asked by 10.10.2017 / 17:49
1
answer

Query 2 tables in a sql database and display repeated values [closed]

I have 2 tables in my database, one call pessoas and another call resultado , I am filling the result table with the draws made by mega sena, the result table has the fields: data, dez1, dez2, dez3, dez4, dez5, dez6 The people...
asked by 10.10.2017 / 05:23
2
answers

How to do a mapping from an Excel column to a database column

I needed help to do the specific mapping of a column from an excel file to a column in a database. I can read the excel file but I just can not map the file to the column I want in the database. If you need any part of the code just ask like any...
asked by 10.10.2017 / 13:22
1
answer

Go through array and check if a field is empty (PHP)

In one of the files I have a PivotTable which receives the data from BD , but with the possibility of inserting more rows in the table. Note that when I enter more rows the idFaturacao will be empty. This is my table: <TABLE...
asked by 28.09.2017 / 11:30
1
answer

Error: There are no primary or candidate keys in the referenced table

I'm trying to relate these two tables IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Periodo') AND type in (N'U')) DROP TABLE Periodo GO CREATE TABLE Periodo( Numero tinyint NOT NULL, SiglaCurso varchar(5) NOT NULL...
asked by 26.10.2017 / 20:12
1
answer

Select subtraction in columns of different tables

I've been trying to perform a select that subtracts one column from one table to another column from another table. Look at the image below what I need: Therefore, I need to add the quantidade column of the lista_geral tab...
asked by 18.10.2017 / 15:38
1
answer

Relationship model and entity

Boy, I'm setting up a website that owns the artist chart and an artist can play more than one musical genre, how would I put the genres that the artist plays in the database?     
asked by 02.10.2017 / 01:20