what is foreign key in mysql

what is foreign key in mysql
foreign   key in mysql

table1

uid name mobile no
                       
                       

table2

id address uid
                                            
                                        

 foreign  key is primary key of another table

for Example here two table  table 1  primary key uid
 table 2  primary key id

uid is foreign  for table 2    but it primary key of table1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s