sqlÖÐɾ³ý±í½á¹¹µÄÏÂÁî
ÔÚ sql ÖУ¬¿ÉÒÔʹÓà drop table ÏÂÁîɾ³ý±í½á¹¹£¬¸ÃÏÂÁî½ÓÄÉÒÔÏÂÓï·¨£ºdrop table table_name;Ö´ÐдËÏÂÁÓÀÊÀɾ³ý±í£¬°üÀ¨±íÊý¾Ý¡¢Íâ¼üÔ¼ÊøºÍË÷Òý¡£Îª×èÖ¹Êý¾Ýɥʧ£¬ÇëÔÚÖ´ÐÐÇ°±¸·Ý±íÊý¾Ý¡£¼¶ÁªÉ¾³ý¿Éͨ¹ýÌí¼Ó cascade Òªº¦×ÖʵÏÖ£¬Í¬Ê±É¾³ýÏà¹ØÍâ¼üºÍË÷Òý¡£
SQL ÖÐɾ³ý±í½á¹¹µÄÏÂÁî
ÔÚ SQL ÖУ¬¿ÉÒÔʹÓà DROP TABLE Óï¾äÀ´É¾³ý±í½á¹¹¡£¸ÃÏÂÁîµÄÓ﷨Ϊ£º
DROP TABLE table_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_name ΪҪɾ³ýµÄ±íÃû¡£
ʹÓÃʾÀý
Ҫɾ³ýÃûΪ customers µÄ±í£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
DROP TABLE customers;
µÇ¼ºó¸´ÖÆ
Ö´ÐдËÏÂÁîºó£¬±í½á¹¹½«±»É¾³ý£¬±íÖеÄËùÓÐÊý¾ÝÒ²½«±»É¾³ý¡£ÐèҪעÖصÄÊÇ£¬´Ë²Ù×÷ÊDz»¿ÉÄæµÄ£¬Òò´ËÔÚÖ´ÐÐ DROP TABLE ÏÂÁî֮ǰ£¬ÇëÈ·±£Òѱ¸·Ý±íÊý¾Ý¡£
¼¶ÁªÉ¾³ý
DROP TABLE ÏÂÁ֧³Ö¼¶ÁªÉ¾³ý£¬ÕâÒâζ×ÅËü¿ÉÒÔͬʱɾ³ý±í¼°ÆäÏà¹ØµÄÍâ¼üÔ¼ÊøºÍË÷Òý¡£ÒªÆôÓü¶ÁªÉ¾³ý£¬¿ÉÒÔÔÚ DROP TABLE Óï¾äÖÐʹÓà CASCADE Òªº¦×Ö¡£
DROP TABLE customers CASCADE;
µÇ¼ºó¸´ÖÆ
×¢ÖØÊÂÏî
DROP TABLE ÏÂÁî»áÁ¬Ã¦Ö´ÐУ¬ÎÞ·¨µõÏú¡£
ÔÚɾ³ý±í֮ǰ£¬ÇëÈ·±£Òѵ¼³ö±íµÄÊý¾Ý£¬ÒÔ·ÀÐèҪδÀ´»Ö¸´¡£
ÈôÊDZí¾ßÓÐÍâ¼üÔ¼Êø£¬ÔòÐèÒªÔÚɾ³ý±í֮ǰɾ³ýÕâЩԼÊø¡£
ɾ³ý±íºó£¬½«ÎÞ·¨ÔÙ¼û¼û±íÖеÄÊý¾Ý¡£
ÒÔÉϾÍÊÇsqlÖÐɾ³ý±í½á¹¹µÄÏÂÁîµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡