mysql - SQL Syntax help -- FOREIGN KEY -



mysql - SQL Syntax help -- FOREIGN KEY -

i have 2 tables, t1 , t2.

t1 has fields id, key_id, title. (id primary key, key_id , title obtained t2.)

and

t2 has fields id, key_id, title , f4. (id obtained t1 , key_id primary key in t2)

can help in writing syntax above using foreign key , primary key

please comment if not clear.

you can't create foreign key constraint t1 t2 before t2 defined, , vice versa. trick create 1 table without fk constraint, create sec table, , utilize alter table add together fk constraint first table.

mysql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -