skip to Main Content

Mysql – Why Can't create table in this way?

I have a set of sql statements, CREATE TABLE PRICING( CodeVillage INT, TypeCabin INT, CodeSeason CHAR(2), WeekPrice INT, PRIMARY KEY(CodeVillage, TypeCabin, CodeSeason) ); CREATE TABLE SEASON( CodeSeason CHAR(2) PRIMARY KEY, NameSeason VARCHAR(20), CONSTRAINT Fk_Pricing_CodeSeason Foreign KEY (CodeSeason) REFERENCES PRICING(CodeSeason) );…

VIEW QUESTION

how to make relationship between to table in laravel?

my database has two table games and teams, games migration: $table->unsignedBigInteger('homeTeam'); $table->unsignedBigInteger('awayTeam'); $table->foreign('homeTeam')->references('id')->on('teams') $table->foreign('awayTeam')->references('id')->on('teams') what is relationship between this two table? many to many? should I create "game_team" pivot table? i tried to change design of database but it don't…

VIEW QUESTION
Back To Top
Search