SQL Drop Database語句例項講解

2022-09-18 04:33:25 字數 839 閱讀 9884

語法

drop database語句的基本語法如下 -

drop database database_name;
注:資料庫名稱在rdbms中必須是唯一的。

示例如果要刪除現有資料庫 -testdb,則drop database語句如下所示 -

drop database testdb;
注意- 在使用此操作之前要小心,因為刪除現有資料庫將會刪除儲存在此資料庫中的完整資訊,比如:表,函式,檢視等都會一起被刪除。

刪除任何資料庫之前,請確保您具有管理員許可權。 刪除資料庫後,可以在資料庫列表中檢視是否刪除成功,如下所示 -

mysql> show databases;

+--------------------+

| database |

+--------------------+

| information_schema |

| mysql |

| performance_schema |

| sqldemo |

| sys |

+--------------------+

5 rows in set

第六講 if 語句

格式 單分支if 條件測試命令 then 命令序列 fi 多分支 if then 命令序列 else 命令序列 fi bin bash data new create if f file then echo exist file cat file wc l rm file else touch fi...

第5講 if 語句 2

第5講if語句 2 一 注釋語句 注釋 注釋語句用來對程式塊進行說明,它對程式執行結果無任何影響。例1輸入三個數,將它們按從小到大的順序輸出 include void main void if a c if b c printf 排序結果是 f,f,f,a,b,c 二 if語句巢狀 p56 如果if...

verilog for 語句例項

1.1要求 實現8位資料低4位左移到高4位 1.2 module move result,in,res,clk input 3 0 in input clk,res output 7 0 result reg 7 0 result integer i always clk or in or res ...