Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
-- Schema health queries -- Find tables without PK SELECT TABLE_NAME FROM information_schema.TABLES t WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME NOT IN ( SELECT TABLE_NAME FROM information_schema.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' ); -- Find nullable FKs that should be NOT NULL DESCRIBE orders;
Result
Open