Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有显示哪些表没有外键的查询或命令?
您可以查询信息架构:
SELECT table_schema, table_name FROM information_schema.tables t WHERE NOT EXISTS (SELECT * FROM table_constraints tc WHERE t.table_schema = tc.table_schema AND t.table_name = tc.table_name AND tc.constraint_type = 'FOREIGN KEY')