A few days ago, I needed to ask to all tables of a database about what is the name of the primary key of each table. The solution is easy, just using the data from the database information_schema, and by retrieving the data for the selected schema, this way: SELECT TABLE_NAME as table, COLUMN_NAME FROM …
The post Listing primary keys of a database in MySQL-MariaDB appeared first on Manejando datos.