Questions tagged as 'sql'

2
answers

group columns in mysql

You have these insert in the table I'd like an sql and it returns me the team total points type: time - points Uruguay - 9 russia - 6 arabia - 3 Egypt - 0     
asked by 03.07.2018 / 02:34
1
answer

SQL - How to undo ambiguous outer join?

I'm trying to normalize a database to addresses and zip codes. However, there is a situation in which the Post Office allocates, for the same public place, a ZIP code for the side with even numbers and another for the side with odd numbers, and...
asked by 04.07.2018 / 22:14
1
answer

Foreign key with 3 primary keys

Hi. I have this table with 3 primary keys and I need to reference it in another table. How? I was going to just put an id of type int in the monthly fee table to be the only primary key. But each monthly fee must be unique to a contract and h...
asked by 05.07.2018 / 04:56
1
answer

Get constraint name and drop then

I have a constraint UNIQUE in the PERSON table and is in the CPF field. To get the name of this contraint I use the query: SELECT UC.CONSTRAINT_NAME FROM USER_CONSTRAINTS UC INNER JOIN USER_TAB_COLUMNS UT ON UT.TABLE_NAME...
asked by 13.06.2018 / 17:04
1
answer

SQL statement in MySQL with CURDATE (), does not display API result with PHP

In this SQL what is wrong? SELECT top.id_topatletas, top.idusuarios, top.posicao, top.workout, top.data_inicio, top.data_fim, user.idusuarios, user.nome FROM top_atle...
asked by 03.09.2018 / 16:25
1
answer

ORA-00907: right parenthesis not found - Help

I'm trying to create the following table in SQL create table Compra ( CodCompra number(3) primary key, DataCompra date, DataEntrega date, Fornecedor foreign key Fornecedor REFERENCES (codfornecedor)Fornecedor )    ORA-009...
asked by 08.09.2018 / 00:29
1
answer

Problem with BD (foreign key)

My script is as follows. It is giving foreign key error and I can not resolve it. CREATE DATABASE teste; USE teste; CREATE TABLE horario ( id_horario int PRIMARY KEY NOT NULL AUTO_INCREMENT, horario time NOT NULL ); CREATE TABLE linha ( id_l...
asked by 22.07.2018 / 20:05
1
answer

how to make a ranking in php? [closed]

[Help] ranking in .php file illustrative image: link site image (main page): link image of accounts created for testing: link I use Xamp, to display the created accounts I'll have to go to localhost / phpmyadmin. Good personal...
asked by 21.08.2018 / 03:58
3
answers

Syntax error in MySQL

I was creating a table in MySQL and this error appeared in this code: USE cadastro; CREATE TABLE países( cod_país INT NOT NULL AUTO_INCREMENT, nome_país VARCHAR (30), PRIMARY KEY cod_país );    1 errors were encountered duri...
asked by 21.08.2018 / 04:57
1
answer

Get Bank ID to load in HTML select

How can I get hold of Bank ID to load in HTML select My function like this: public function ComboBox($sql, $idcampo, $selected) { $cn = conexao::getInstance()->prepare($sql); echo "<select name='" . $idcampo . "'>";...
asked by 29.08.2018 / 14:25