1
alter table tut ADD Constraint MyUniqueness unique (tutorial_title ) ;
desc tut;

here I am not getting constraint name i.e. "MyUniqueness"

Shadow
  • 33,525
  • 10
  • 51
  • 64

2 Answers2

0

DESCRIBE doesn't show constraints. Use SHOW CREATE TABLE.

SHOW CREATE TABLE tut;
Barmar
  • 741,623
  • 53
  • 500
  • 612
0

Got the answer:

select * 
from information_schema.table_constraints 
where table_name = "table_Name";
GMB
  • 216,147
  • 25
  • 84
  • 135