對邏輯資料庫的操作

2021-08-19 18:47:40 字數 627 閱讀 8186

使用資料庫語言時,一定要注意以分號結尾(;)

1、建立資料庫create database 資料庫名;

create database scores;//建立指定名稱的資料庫,字符集使用的是「安裝資料庫時的指定的字符集」;

create database 資料庫名 character set 字符集;

create database scores02 character set gbk; #建立指定名稱的資料庫,並設定指定的字符集;

2、檢視資料庫show databases;

#檢視資料庫mysql伺服器中「所有」的資料庫,注意:這裡使用的是「databases」不是「database」;

show create database 資料庫名;

show create database scores; #檢視某個資料庫定義時的資訊;

3、刪除資料庫drop database 資料庫名;

drop database scores;

4、使用資料庫檢視正在使用的資料庫

select database();

use 資料庫名;切換資料庫。

use student;

互相學習,有錯請指教!

對QSqlite資料庫的操作

首先新建乙個資料庫 qsqldatabase db qsqldatabase adddatabase qsqlite db.setdatabasename database.db 給資料庫檔案加密 db.setusername hsl db.setpassword 000000 注意,這僅僅是對da...

對QSqlite資料庫的操作

首先新建乙個資料庫 qsqldatabase db qsqldatabase adddatabase qsqlite db.setdatabasename database.db 給資料庫檔案加密 db.setusername hsl db.setpassword 000000 注意,這僅僅是對da...

邏輯資料庫

定義邏輯資料庫,對於訪問資料來說在效能上有較大的提高。對於有附加 邏輯資料庫 的報表程式 最重要的 事件是邏輯 資料庫程式 從資料庫表 中讀取了行 的時刻 參 見 用邏輯資料庫訪問資料 要在此 事件處啟動 過程塊,請 按照下列方 法使用 get 語句 get fields 此語句之後 可以使用 資料...