sqlÖÐdescÊÇʲôÒâ˼
sql ÖÐµÄ desc ÏÂÁîÓÃÓÚÏÔʾ±íµÄ¼Ü¹¹ÐÅÏ¢£¬°üö¾ÙÃû¡¢Êý¾ÝÀàÐÍ¡¢Ô¼ÊøºÍĬÈÏÖµ£¬¿É×ÊÖúÓû§Ïàʶ±íµÄ½á¹¹£¬ÏêϸÓï·¨ÈçÏ£ºdesc table_name;
SQL ÖÐµÄ DESC
DESC ÊÇ SQL ÖеÄÒªº¦×Ö£¬ÓÃÓÚÏÔʾ±íµÄ¼Ü¹¹ÐÅÏ¢£¬°üö¾ÙÃû¡¢Êý¾ÝÀàÐÍ¡¢Ô¼ÊøºÍĬÈÏÖµ¡£ËüÊÇÒ»¸öÖ÷ÒªµÄÊý¾Ý¿â²Ù×÷£¬¿ÉÒÔ×ÊÖúÓû§Ïàʶ±íµÄ½á¹¹²¢ÕÒ³öÊý¾ÝÖеĹýʧ¡£
Óï·¨
DESC table_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_name ÊÇÒªÅÌÎʼܹ¹ÐÅÏ¢µÄ±íµÄÃû³Æ¡£
·µ»ØЧ¹û
DESC ÏÂÁî·µ»ØÒ»¸öЧ¹û¼¯£¬ÆäÖаüÀ¨ÒÔÏÂÁУº
Field£ºÁÐÃû
Type£ºÁеÄÊý¾ÝÀàÐÍ
Null£ºÊÇ·ñÔÊÐí¿ÕÖµ£¨YES »ò NO£©
Key£ºÊÇ·ñΪÖ÷¼ü»òÍâ¼ü£¨PRI¡¢MUL »ò NULL£©
Default£ºÄ¬ÈÏÖµ£¨ÈôÊÇÓУ©
Extra£ºÆäËûÐÅÏ¢£¨Èç×ÔÔöÁбêʶµÈ£©
ʾÀý
ÒÔÏÂʾÀýÏÔʾ±í customers µÄ¼Ü¹¹ÐÅÏ¢£º
DESC customers;
µÇ¼ºó¸´ÖÆ
Êä³ö¿ÉÄÜÈçÏÂËùʾ£º
Field Type Null Key Default Extra id int NO PRI NULL auto_increment name varchar(255) YES NULL NULL email varchar(255) YES UNI NULL phone varchar(255) YES NULL NULL
µÇ¼ºó¸´ÖÆ
ÓÃ;
DESC ÏÂÁîÔÚÒÔÏÂÇéÐÎϺÜÊÇÓÐÓãº
ÑéÖ¤±íµÄ¼Ü¹¹ÊÇ·ñÓëÔ¤ÆÚÏà·û
ʶ±ðÊý¾ÝÀàÐͲ»Æ¥Åä»òÔ¼ÊøȱʧµÈ¹ýʧ
Ïàʶ±íÖÐÁеÄĬÈÏÖµºÍÏÞÖÆ
×ÊÖúÍýÏëÊý¾Ý¿âÐ޸ĺÍÊý¾Ý¼ÓÔزÙ×÷
ÒÔÉϾÍÊÇsqlÖÐdescÊÇʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡