Questions tagged as 'sql'

5
answers

Login system with PHP [closed]

Hello, I need to do an administrative area, and obviously I need a login system and password. I know there are already questions here, but I fear they are outdated. I want a way inside the simple and safe possible. I also do not want anyone to d...
asked by 07.12.2015 / 18:46
3
answers

Query INSERT with WHERE condition

How can I make an insert with a where condition? I have the following query: INSERT INTO 'registro'('id', 'username') values ('','USER_1'), ('','USER_2'), ('','USER_3') It will add a new user to the table record. Except that I need it...
asked by 12.04.2018 / 15:59
3
answers

Viability to create 200 columns in database [closed]

I am planning software, which is a test of 200 questions where each question can only have 3 choices and select only one, and each question belongs to a class type (eg question 5 belongs to class B , are classes from A to J) and I need to save t...
asked by 28.03.2016 / 20:35
2
answers

How to concatenate two Data?

How to concatenate two dates of type DateTime , one of which may have its value equal to NULL , I'm trying as follows; DECLARE @DATA1 DATETIME = GETDATE(), @DATA2 DATETIME select Convert(nvarchar(50),@DATA1 , 121) +'|'+ Convert(n...
asked by 25.07.2016 / 15:17
4
answers

What kind of data to use for sale ID

I have a Windows Form application developed in C # and with SQL database. One of the functions of the system is to carry out SALES for different companies and different POS (different point of sale), however, using a single database. I use ID...
asked by 18.10.2016 / 13:43
2
answers

Which is more efficient, perform multiple queries or use JOIN?

I have a X table that has my user's data, and I need to return data related to that user to the Y and Z table to the client. I can do this using JOIN or: SELECT attr1, attr2 FROM Y WHERE X_id = id SELECT attr1, attr...
asked by 01.11.2017 / 14:54
3
answers

Prevent data from appearing in MYSQL search

I have a table consisting of the following columns, ID , Produto , Compra , Venda and Resultado . I know the syntax for selecting the values I want, eg Select * From tabela_exemplo where Produto = '030'; How...
asked by 13.09.2017 / 15:30
2
answers

Rebuild tables without dropping

I have a table already populated. In it there is a not null field, which I need to set to null. In graphical mode does not accept and says that I have to re-create the table. Is there any way I can do this without having to drop the table and st...
asked by 04.02.2015 / 13:28
3
answers

Retrieve MAX value from an SQL column

string var = ""; SqlConnection con = new SqlConnection(Banco._strCon); string sql = "select max(end_id) from endereco"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if...
asked by 27.10.2015 / 16:26
2
answers

A MySQL query, with 'crases' vs without

With quotes is the query safer or less? $Query = "Select * from 'tabela' WHERE 'id' = '1'"; vs $Query = "Select * from tabela WHERE id = 1";     
asked by 08.08.2015 / 20:17