I'm selecting my table schema data like this
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE,CHARACTER_MAXIMUM_LENGTH
FROM information_schema.columns
WHERE table_schema = DATABASE()
ORDER BY table_name, ordinal_position
I'm getting all column related data in that. How can I get whether a column is participating in a primary key or not with Y or N like this
ColumnName Primary key
t1 Y t2 N