alter table key2movie 
add foreign key (movie)
references movies(id)
;

alter table key2movie 
add foreign key (keyword)
references keyword(word)
;

alter table plot2movie 
add foreign key (movie)
references movies(id)
;

alter table plot2movie 
add foreign key (plot)
references plot(id)
;

alter table movieLinks
add foreign key (link)
references link(id)
;

alter table goof2movie 
add foreign key (movie)
references movies(id)
;

alter table goof2movie 
add foreign key (goof)
references goof(id)
;

alter table altversion2movie 
add foreign key (movie)
references movies(id)
;

alter table altversion2movie 
add foreign key (altversion)
references altversion(id)
;


alter table trivia2movies 
add foreign key (movie)
references movies(id)
;

alter table trivia2movies 
add foreign key (trivia)
references trivia(id)
;


alter table tag2movie 
add foreign key (movie)
references movies(id)
;

alter table tag2movie 
add foreign key (tag)
references tag(id)
;


alter table crazycredit2movie 
add foreign key (movie)
references movies(id)
;

alter table crazycredit2movie 
add foreign key (credit)
references crazycredit(id)
;


alter table lang2movie 
add foreign key (movie)
references movies(id)
;

alter table lang2movie 
add foreign key (language)
references language(name)
;

alter table plot 
add foreign key (id)
references plot2movie(plot)
;

alter table link
add foreign key (id)
references movieLinks (link)
;

alter table goof 
add foreign key (id)
references goof2movie(goof)
;

alter table altversion 
add foreign key (id)
references altversion2movie(altversion)
;

alter table trivia 
add foreign key (id)
references trivia2movies(trivia)
;

alter table crazycredit 
add foreign key (id)
references crazycredit2movie(credit)
;

alter table musicby 
add foreign key (composerN,composerS)
references composer(name,surname)
;

alter table musicby 
add foreign key (movie)
references movies(id)
;

alter table writerby 
add foreign key (writerN,writerS)
references writer(name,surname)
;

alter table writerby 
add foreign key (movie)
references movies(id)
;


alter table tracklist 
add foreign key (soundtrack)
references soundtrack(name)
;

alter table tracklist 
add foreign key (movie)
references movies(id)
;

alter table prodcompany2movie 
add foreign key (prodcompany)
references prodcompany(name)
;

alter table prodcompany2movie 
add foreign key (movie)
references movies(id)
;

alter table prodcompany 
add foreign key (name)
references prodcompany2country(prodcompany)
;

alter table actor2movie
add foreign key (movie)
references movies(id)
;

alter table actor2movie 
add foreign key (actor)
references actor(id)
;

alter table akaname
add foreign key (akaname,akasurname)
references actorsAka(akaname,akasurname)
;

alter table actorsAka
add foreign key (actor)
references actor(id)
;

alter table actorsAka
add foreign key (akaname,akasurname)
references akaname(akaname,akasurname)
;

alter table prodby 
add foreign key (producerN,producerS)
references producer(name,surname)
;

alter table prodby 
add foreign key (movie)
references movies(id)
;

alter table prodcompany2country 
add foreign key (prodcompany)
references prodcompany(name)
;

alter table prodcompany2country
add foreign key (country)
references country(name)
;

alter table akatitle
add foreign key (title)
references moviesaka(akatitle)
;

alter table itakatitle
add foreign key (title)
references moviesItaka(itakatitle)
;

alter table designer2movie
add foreign key (designerN,designerS)
references designer(name,surname)
;

alter table designer2movie
add foreign key (movie)
references movies(id)
;

alter table distributed
add foreign key (movie)
references movies(id)
;

alter table distributed
add foreign key (distributor)
references distributor(name)
;

alter table distributor
add foreign key (name)
references distributor2country(distributor)
;

alter table sfxby
add foreign key (sfxcompany)
references sfxcompany(name)
;

alter table sfxby
add foreign key (movie)
references movies(id)
;


alter table sfxcompany
add foreign key (name)
references country2sfx(sfxcompany)
;


alter table located
add foreign key (locationcity)
references location(city)
;

alter table located
add foreign key (locationcountry)
references country(name)
;

alter table located
add foreign key (movie)
references movies(id)
;


alter table location
add foreign key (country)
references country(name)
;

alter table shotin
add foreign key (country)
references country(name)
;

alter table shotin
add foreign key (movie)
references movies(id)
;

alter table certificate
add foreign key (movie)
references movies(id)
;

alter table certificate
add foreign key (country)
references country(name)
;

alter table editby
add foreign key (movie)
references movies(id)
;

alter table editby
add foreign key (editorN,editorS)
references editor(name,surname)
;

alter table proddesignby
add foreign key (movie)
references movies(id)
;

alter table proddesignby
add foreign key (proddesignerN,proddesignerS)
references proddesigner(name,surname)
;

alter table directedby
add foreign key (movie)
references movies(id)
;


alter table directedby
add foreign key (directorN,directorS)
references director(name,surname)
;

alter table cinematographyby
add foreign key (movie)
references movies(id)
;

alter table cinematographyby
add foreign key (cinematographerN,cinematographerS)
references cinematographer(name,surname)
;

alter table releasein
add foreign key (movie)
references movies(id)
;

alter table releasein
add foreign key (country)
references country(name)
;


alter table movies
add foreign key (id)
references proddesignby(movie)
;

alter table movies
add foreign key (id)
references directedby(movie)
;

alter table movies
add foreign key (id)
references editby(movie)
;

alter table movies
add foreign key (id)
references cinematographyby(movie)
;


alter table moviesAka
add foreign key (akatitle)
references akatitle(title)
;

alter table moviesAka
add foreign key (movie)
references movies(id)
;


alter table moviesItaka
add foreign key (itakatitle)
references itakatitle(title)
;


alter table moviesItaka
add foreign key (movie)
references movies(id)
;


alter table distributor2country
add foreign key (distributor)
references distributor(name)
;

alter table distributor2country
add foreign key (country)
references country(name)
;

alter table country2sfx
add foreign key (sfxcompany)
references sfxcompany(name)
;

alter table country2sfx
add foreign key (country)
references country(name)
;










