I have a column where I store the values:
Nome | Turma | Nota1 | Nota2 | Nota3 | Nota4
How would I get the highest grade from the Note1, Note2, Note3, and Note4 fields? I understand that MAX () does this, but how could I apply to my need?...
I have this query that returns the last record and the last one:
SELECT Colaborador
FROM centrodb.Registolistagem
LEFT OUTER JOIN centrodb.Registolistagem2 ON centrodb.Registolistagem2.IdLista = centrodb.Registolistagem.Id
WHERE Carro = 'G3...
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...
I'm trying to make a simple login system to learn and improve it, I used a basic material I saw in devmedia, and the matter was already old because it still used mysql instead of mysqli for connection, in that matter did not contain logout, afte...
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...
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...
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...
I'm trying to create a foreign key, but it's an error.
Here is the code I'm using:
CREATE TABLE foto(
id INT(10),
img varchar(25),
nome varchar(25),
link varchar(25),
vew INT(10),
tkm VARCHAR(100),
moder INT(1),...