0 votes
60 views
in MySQL by
How to show unique constraints of a table in MySQL?

1 Answer

0 votes
by (5k points)

MySQL unique key constraint – A unique key is a set of single or multiple columns of a table that uniquely identifies the records in table. A Unique Key assures that value in the column will be unique throughout the table.

To Show table unique constraints use the following command:-

select distinct CONSTRAINT_NAME from information_schema.TABLE_CONSTRAINTS where CONSTRAINT_SCHEMA = 'mysql'

If you want to show table select statement with description use the following code:-

SHOW CREATE TABLE table_name;

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...