There is an username/password verification step first then the database has following structure
^ is primary key * uses foreign key 1.StudentDetails table ===
It's better to use foreign keys in number format So the Username should be the id of the StudentDetails table.
Can you put the SQL Query that you had tried to run?