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

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

Shadow
  • 32,277
  • 10
  • 49
  • 61

2 Answers2

0

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

SHOW CREATE TABLE tut;
Barmar
  • 669,327
  • 51
  • 454
  • 560
0

Got the answer:

select * 
from information_schema.table_constraints 
where table_name = "table_Name";
GMB
  • 195,563
  • 23
  • 62
  • 110