sql query to find foreign key references