mysqlÖÐdescribeÔõôÓÃ
mysql ÖÐµÄ describe ÏÂÁîÓÃÓÚ»ñÈ¡±íµÄÔªÊý¾ÝÐÅÏ¢£¬°üÀ¨£º×Ö¶ÎÃû³Æ¡¢Êý¾ÝÀàÐÍ¡¢³¤¶È¡¢ÊÇ·ñÔÊÐí¿ÕÖµ¡¢Ä¬ÈÏÖµ¡¢¼ü¡£Ëü·µ»ØÒ»¸öЧ¹û¼¯£¬°üÀ¨Óйرí½á¹¹¡¢ÁÐÀàÐÍ¡¢Ô¼ÊøºÍË÷ÒýµÄÏêϸÐÅÏ¢¡£
MySQL ÖÐµÄ DESCRIBE ÏÂÁî
DESCRIBE ÏÂÁîÓÃÓÚ»ñÈ¡ÓйØÊý¾Ý¿âÖбíµÄÔªÊý¾ÝÐÅÏ¢£¬ÀýÈç±í½á¹¹¡¢ÁÐÀàÐÍ¡¢Ô¼ÊøºÍË÷Òý¡£
Óï·¨
DESCRIBE ;
µÇ¼ºó¸´ÖÆ
Ó÷¨
Ö´ÐÐ DESCRIBE ÏÂÁîʱ£¬Ëü»á·µ»ØÒ»¸öЧ¹û¼¯£¬ÆäÖаüÀ¨ÓйØÖ¸¶¨±íµÄÒÔÏÂÐÅÏ¢£º
×Ö¶ÎÃû³Æ£º±íµÄÿһÁеÄÃû³Æ¡£
Êý¾ÝÀàÐÍ£ºÃ¿ÁÐÖд洢Êý¾ÝµÄÀàÐÍ£¬ÀýÈç INT¡¢VARCHAR »ò DATE¡£
³¤¶È£ºÃ¿ÁÐÔÊÐíµÄ×î´ó×Ö·ûÊý»òÊý×Ö³¤¶È¡£
ÊÇ·ñÔÊÐí¿ÕÖµ£ºÃ¿ÁÐÊÇ·ñÔÊÐí´æ´¢ NULL Öµ¡£
ĬÈÏÖµ£º²åÈëÐÂÐÐʱ£¬ÈôÊÇδָ¶¨ÁÐÖµ£¬ÔòʹÓõÄĬÈÏÖµ¡£
¼ü£ºÁÐÊÇ·ñΪÖ÷¼ü¡¢Íâ¼ü»òË÷ÒýµÄÒ»²¿·Ö¡£
¸½¼ÓÐÅÏ¢£ºÓйØÁеÄÆäËûÐÅÏ¢£¬ÀýÈç×Ô¶¯ÔöÁ¿»òΨһÐÔÔ¼Êø¡£
ʾÀý
ÈÃÎÒÃÇʹÓà DESCRIBE ÏÂÁî»ñÈ¡ÓйØÃûΪ “customers” µÄ±íµÄÔªÊý¾ÝÐÅÏ¢£º
DESCRIBE customers;
µÇ¼ºó¸´ÖÆ
Êä³öЧ¹ûÀàËÆÓÚ£º
Field | Type | Null | Key | Default | Extra -------+-------------+------+-----+---------+------ id | int(11) | NO | PRI | NULL | auto_increment name | varchar(255) | NO | | NULL | email | varchar(255) | NO | | NULL |
µÇ¼ºó¸´ÖÆ
Õâ¸öÊä³öÌåÏÖ£º
“customers” ±í°üÀ¨Ëĸö×ֶΣºid¡¢name¡¢email ºÍ created_at¡£
“id” ×Ö¶ÎÊÇÖ÷¼ü£¬²¢ÇÒÔÊÐí×Ô¶¯ÔöÁ¿¡£
“name” ºÍ “email” ×Ö¶ÎÊÇ VARCHAR ÀàÐÍ£¬ÔÊÐí´æ´¢×î¶à 255 ¸ö×Ö·û¡£
ËùÓÐ×ֶζ¼²»ÔÊÐíΪ¿ÕÖµ¡£
ÒÔÉϾÍÊÇmysqlÖÐdescribeÔõôÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡