I'm trying to create a database where two tables have a relation to an intermediate table.
The idea is simple; a table stores user records, their passwords, emails etc, while the other stores levels. (The levels belong to a kind of videogame where the registered user can select which level he wants to play, and in the intermediary table a query is made when he has passed it.) niveles
stores attributes such as the level, the description of the level and the points obtained after passing the level.
So we have the table usuarios
, the table niveles
and the table niveles_pasados
.
niveles_pasados
stores only the user's information, the past level, and the points earned by passing it.
What I intend is, that each time the user manages to pass a level, perform a insert into
within niveles_pasados
, storing the information of the user who passed it, the level it passed, and the points it earned.
I tried to create the tables and relate them to the next dumbbell, but when I entered data in the table niveles_pasados
, I returned the following error.