A better understanding of the relations beetween database tables

Posted by Nistor Alexandru on Stack Overflow See other posts from Stack Overflow or by Nistor Alexandru
Published on 2012-10-18T10:58:36Z Indexed on 2012/10/18 11:00 UTC
Read the original article Hit count: 161

Filed under:
|
|

Hi I am trying to get a better understanding of relational databases and there is something that I keep bumping into and don't understand.Let's take this two tables:

enter image description here

In this case Login.ID is the primary key with auto_increment set and Profile.ID_LOGIN is the Foreign KEY.When a user is created and it's username and password is stored in the login database does the ID coresponding to the curesnt username and password get automaticly added into ID_LOGIN or do I have to create an SQL statement to do this?

If I have to create a SQL statement how should I aproach adding the ID_LOGIN to make sure I am adding it corectly?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql