-2

I have got a column of images in my MySQL database, but I would like to know what column flag I should use? (PK, NN, UQ, BIN, UN, ZF, AI) Or do they even matter?

Edit: maybe I should mention that it's a blob datatype

Thanks..

1 Answers1

1

First: Understand what each flag means:

  • PK: Primary key: Meant for primary keys (obviously, a BLOB can't be a PK)
  • NN: Not nullable: Is the field mandatory? If it is, use this flag
  • UQ: Unique: Forces a unique index on the column (again, not a good idea on a BLOB)
  • BIN: Binary: Stores strings as binary strings (not necesary for BLOB)
  • UN: Unsigned: Only non-negative numbers (could a BLOB be positive or negative?)
  • ZF: Zero-fill: Left-pad number values with zeros (do I really need to say anything related to BLOBs regarding this?)
  • AI: Auto-incremental (Do I really need to explain this?)
Barranka
  • 20,547
  • 13
  • 65
  • 83