Relations between tables

i have quistion,

i have 2 table
user include two column “id”,“name”

and products include two column "id ",“name”

and i have user oage and when i see user profile i wana see the products that he or she ordered,
how i set foreign key on this?and add how many column on which table to do this i mean set forign key ,how i set this,im noob on relations…could you help?

Basic form is

SELECT table1.field1
     , table1.field2
     , table2.field3
     , table2.field4
  FROM table1
 INNER JOIN table2 ON table1.idField = table2.idField
 WHERE table1.field1 = 'searchvalue'
1 Like


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.