6: added foreign key constraints to table creation function.