How can I find which column is the primary key of a table by using a query?
In mySQL
SHOW COLUMNS FROM `table_name`;
This show the details of the columns ie field, data-type, key etc.