There are many way to find tables without primary key one of them described below.
Select Table_CataLogasDB_NAME, Table_SchemaasTBL_SCHEMA, Table_NameasTBL_NAME from information_schema.tablesT where NotExists( Select 1 from information_Schema.Table_ConstraintsC where Constraint_Type='PRIMARY KEY' andC.Table_Name=T.Table_Name andC.Table_Schema=T.Table_Schema ) andTable_Type='BASE TABLE' |
This query will fetch all tables’ information which do not have primary key.