Added proper foreign key linking for tables in sql database creation