mysql一些sql語句,查看表信息 查看表字段信息 Java代碼 SELECT column_name AS `列名`, data_type AS `數據類型`, character_maximum_length AS `字符長度`, numeric_precision AS `數字長度`, numeric_scale AS `小數位數`, is_nullable AS `是否允許非空`, CASE WHEN extra = 'auto_increment' THEN 1 ELSE 0 END AS `是否自增`, column_default AS `默認值`, column_comment AS `備注` FROM Information_schema.columns WHERE table_Name='test'; 2.顯示數據庫 表中數據項信息 Java代碼 SHOW TABLE STATUS FROM `database_name`; 3.顯示表名 Java代碼 SHOW TABLES FROM `database_name`;