can anyone explain to me how to use primary and foreign keys in a mysql schema. how is linking two tables together with primary and foreign keys useful? if I do a select on a table will I be able to pull data from fields in a second table that is linked by a foreign key?
for example:
Table_a
request_id (primary key)
request_type
usr_id (FK)
Table_b
usr_id (primary key)
usr_name
usr_email
can I do this with my select statement:
SELECT usr_name, usr_email, request_type FROM Table_a, Table_b WHERE request_id = '1234'
if not then how would I do this? and what is the advantage of putting my data into 3rd normal form?
I know that I learned this before, but it has been a long time since I've done this stuff, and I need to relearn it. I would really appreciate any explaination. thank you in advanced.
for example:
Table_a
request_id (primary key)
request_type
usr_id (FK)
Table_b
usr_id (primary key)
usr_name
usr_email
can I do this with my select statement:
SELECT usr_name, usr_email, request_type FROM Table_a, Table_b WHERE request_id = '1234'
if not then how would I do this? and what is the advantage of putting my data into 3rd normal form?
I know that I learned this before, but it has been a long time since I've done this stuff, and I need to relearn it. I would really appreciate any explaination. thank you in advanced.
