1.查看表结构:
SELECT column_name,data_type FROM information_schema.columns WHERE table_name='数据库表名';
2.查看表的主键:
SELECT column_name AS 主键 FROM INFORMATION_SCHEMA.`KEY_COLUMN_USAGE` WHERE table_name='数据库表名' AND constraint_name='PRIMARY'