Is it Considered Good SQL practice to use GUID to link multiple tables to same Id field?

Posted by Mallow on Programmers See other posts from Programmers or by Mallow
Published on 2012-11-13T01:23:31Z Indexed on 2012/11/13 5:14 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

I want to link several tables to a many-to-many(m2m) table.

One table would be called location and this table would always be on one side of the m2m table.

But I will have a list of several tables for example:

  • Cards
  • Photographs
  • Illustrations
  • Vectors

Would using GUID's between these tables to link it to a single column in another table be considered 'Good Practice'? Will Mysql let me to have it automatically cascade updates and delete? If so, would multiple cascades lead to an issues?

Diagram example of proposed structure

UPDATE

I've read that GUID (a hex number) Generally takes up more space in a database and slows queries down. However I could still generate 'unique' ids by just having the table initial's as part of the id so that the table card's id would be c0001, and then Illustrations be I001. Regardless of this change, the questions still stands.

© Programmers or respective owner

Related posts about sql

Related posts about mysql