mysqlÖÐdescÊÇʲô
desc ÊÇ mysql ÖÐÉó²é±í½á¹¹µÄÏÂÁʹÓÃÓï·¨£ºdesc table_name¡£ËüÊä³ö×Ö¶ÎÐÅÏ¢£¬°üÀ¨Ãû³Æ¡¢ÀàÐÍ¡¢¿ÕÖµÔÊÐí¡¢Ë÷Òý״̬¡¢Ä¬ÈÏÖµºÍ¸½¼ÓÐÅÏ¢¡£ÀýÈ磺desc customers ·µ»Ø id£¨int£¬Ö÷¼ü£¬×Ô¶¯µÝÔö£©¡¢name£¨varchar(255)£¬ÔÊÐí¿ÕÖµ£¬ÓÐË÷Òý£©¡¢email£¨varchar(255)£¬²»ÔÊÐí¿ÕÖµ£¬Î¨Ò»Ë÷Òý£©¡¢phone£¨varchar(255)£¬ÔÊÐí¿ÕÖµ£¬ÓÐË÷Òý£©¡¢address£¨text£¬ÔÊÐí¿ÕÖµ£¬ÓÐË÷Òý£©µÈ×Ö¶ÎÐÅÏ¢¡£
ʲôÊÇ MySQL ÖÐµÄ DESC£¿
DESC ÊÇ MySQL ÖÐÓÃÓÚÏÔʾ±í½á¹¹µÄÒ»ÌõÏÂÁî¡£ËüÒԿɶÁµÄÐÎʽÁгöÁ˱íÖеÄËùÓÐ×ֶμ°ÆäÊôÐÔ¡£
ÔõÑùʹÓà DESC£¿
ҪʹÓà DESC ÏÂÁֻÐèÔÚ MySQL ÌáÐÑ·ûÏÂÊäÈëÒÔÏÂÓï·¨£º
DESC table_name;
µÇ¼ºó¸´ÖÆ
ÆäÖÐ table_name ÊÇÒªÅÌÎÊÆä½á¹¹µÄ±íÃû¡£
DESC ÏÂÁîÊä³ö
DESC ÏÂÁ·µ»ØÒÔÏÂÐÅÏ¢£º
Field: ×Ö¶ÎÃû³Æ
Type: ×Ö¶ÎÊý¾ÝÀàÐÍ
Null: ָʾ¸Ã×Ö¶ÎÊÇ·ñÔÊÐí¿ÕÖµ£¨YES »ò NO£©
Key: ָʾ¸Ã×Ö¶ÎÊÇ·ñΪË÷ÒýµÄÒ»²¿·Ö£¨Ö÷¼ü¡¢Î¨Ò»Ë÷ÒýµÈ£©
Default: ×ֶεÄĬÈÏÖµ£¨ÈôÓУ©
Extra: ÓйØ×ֶεĸ½¼ÓÐÅÏ¢£¨ÀýÈ磬×Ô¶¯µÝÔö£©
ʾÀý
ÀýÈ磬ҪÉó²é customers ±íµÄ½á¹¹£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
DESC customers;
µÇ¼ºó¸´ÖÆ
Êä³ö¿ÉÄÜÈçÏÂËùʾ£º
Field Type Null Key Default Extra ---------------- -------- -------- -------- -------- -------- id int NO PRI NULL auto_increment name varchar(255) NO MUL NULL email varchar(255) NO UNI NULL phone varchar(255) YES MUL NULL address text YES MUL NULL
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇmysqlÖÐdescÊÇʲôµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡