Questions tagged as 'sql'

1
answer

Using "select" in sql (oracle), failed to fetch

I have to solve the following question:    1.CONSULT THE NAME (DESCRIPTION) OF THE PRODUCTS ACQUIRED BY HOOPS AND GOOD SPORT CLIENTS IN 1990. The command used for the search was: select p.DESCRIPTION from PRODUCT p, SALES_ORDER s, ITEM...
asked by 30.08.2017 / 06:24
1
answer

How to make a join of 2 tables and where 2 fields of table A refer to the same field as table B?

I have the SQL command that does not work: SELECT GAT_requisicao.id_GATrequisicao as 'ID Requisição', GAP_atendimento.id_GAPatendimento as 'ID Atendimento', GR_paciente.nome_GRpaciente as 'Nome Paciente', GR_setor.nome_GRseto...
asked by 30.08.2017 / 16:10
0
answers

How do I record the data of a form in the database in Laravel 5.4?

I have a small problem in producing a registration system, everything is working fine, but when I check in the database no data submitted in the form appears, ie it is not registered. Controller Class: public function Submit(Request $req...
asked by 18.09.2017 / 16:54
1
answer

Join between tables that are not directly related

I have three tables: Candidate that has an ID as pk (which was invented) Application that has FK for Candidate ENEM that does not have any id that represents the candidate, only his / her registration and information such as color / race...
asked by 18.09.2017 / 03:54
1
answer

Working days function

The query below in datediff is bringing the days difference correctly, but I only want to bring the amount of working days. I already have a working day function that excludes Saturdays, Sundays and holidays. But I'm having trouble put...
asked by 18.09.2017 / 15:33
1
answer

Error "This type of clause was previously parsed. (near "UPDATE" at position 55) "

Hello, I'm updating some information from a database, in which I have to update several, using: UPDATE item SET item_mapa = '2' WHERE item_id = '263' UPDATE item SET item_mapa = '2' WHERE item_id = '264' UPDATE item SET item_mapa = '2' WHERE it...
asked by 28.08.2017 / 15:55
1
answer

How to give select between one hour_minute and another in SQL

I need to resolve a simple exercise requesting to report the amount of books sold between 1:00 pm and 5:30 pm on all dates. I was able to pull between 13h and 17h but not with the "17h30" minutes. I did so: SELECT SUM(quantidade) FROM n...
asked by 10.09.2017 / 06:06
2
answers

SQL - query for True or False records

I'm putting together a simple page that shows records marked as blocked by admin. The field is user-block and the options are FALSE or TRUE. I imagined that Query would be: "Select * from Usuarios WHERE user-block = "&TRUE&" order b...
asked by 27.08.2017 / 02:11
0
answers

Difficulty in interpreting database diagram

Good Night. I'm having some problems in interpreting a diagram that from it I'm going to make a sql bank. My programming skills are not very good and I would greatly appreciate it. In case I will use phpmyadmin to mount, I just have some doubts...
asked by 10.09.2017 / 01:07
1
answer

How to remove duplicate lines efficiently?

I'm normalizing a table here and found that there are duplicate rows. The way I chose to clean these lines is through: CREATE TABLE tabela_nova AS ( SELECT DISTINCT * FROM tabela_antiga ); The problem this way is that it is very slo...
asked by 10.06.2015 / 01:56