I am trying to make a query in which the query tries to record for each season the average obtained by the rest of the players in that same season and when making the query it sends me this error I am working on mysql and this is my query and my boards
CREATE TABLE jugadores (
codigo int NOT NULL,
Nombre varchar(30) DEFAULT NULL,
Procedencia varchar(20) DEFAULT NULL,
Altura varchar(4) DEFAULT NULL,
Peso int DEFAULT NULL,
Posicion varchar(5) DEFAULT NULL,
Nombre_equipo varchar(20) DEFAULT NULL,
PRIMARY KEY (codigo),
FOREIGN KEY (Nombre_equipo) References equipos(Nombre)
)engine=innodb;
CREATE TABLE equipos (
Nombre varchar(20) NOT NULL,
Ciudad varchar(20) DEFAULT NULL,
Conferencia varchar(4) DEFAULT NULL,
Division varchar(9) DEFAULT NULL,
PRIMARY KEY (Nombre)
)engine=innodb;
CREATE TABLE jugador (
codigo int NOT NULL,
Nombre varchar(30) DEFAULT NULL,
Procedencia varchar(20) DEFAULT NULL,
Altura varchar(4) DEFAULT NULL,
Peso int DEFAULT NULL,
Posicion varchar(5) DEFAULT NULL,
PRIMARY KEY (codigo)
)engine=innodb;
CREATE TABLE IF NOT EXISTS Temporada (
idTemporada INT(11) NOT NULL,
Nombre VARCHAR(30) NOT NULL,
FechaInicio DATETIME NOT NULL,
FechaFin DATETIME NOT NULL,
PRIMARY KEY (idTemporada))
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS Temporada_Equipo_Jugador (
Id INT(11) NOT NULL,
Nombre_equipo varchar(20) DEFAULT NULL,
jugador_codigo INT(11) NOT NULL,
Temporada_idTemporada INT(11) NOT NULL,
PRIMARY KEY (Id),
FOREIGN KEY (Nombre_equipo) References equipos(Nombre),
foreign key (jugador_codigo) references jugador(codigo),
foreign key (Temporada_idTemporada) references Temporada(idTemporada));
insert into temporada values ((
select AVG(a.estadisticas)
from estadisticas a, jugador b
where a.nombre = b.codigo
group by b.id_jugador
));
this is the error column count doesn't match value count at row 1