0

I have worked with databases before where the key attributes for entities looked like

83NG92R8B202NG

I am trying to build a db myself and was wondering if there was a sql command that automatically assigned a key to an added tuple or I had to create some sort of random attribute algorithm myself.

Chad Pendergast
  • 366
  • 1
  • 4
  • 11

1 Answers1

0

Why not use a UUID? More information in mysql docs:

http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid

If that doesn't fit your needs, take a look at this topic:

Generating a random & unique 8 character string using MySQL

Community
  • 1
  • 1
DaanCelie
  • 163
  • 1
  • 3
  • 8