Added foreignkey constraints
Added multiple check