linux資料庫常用指令

2022-02-08 12:42:53 字數 1585 閱讀 4963

linux資料庫環境搭建好之後,我們就可以建立資料庫了,如果不是

首先我們來建立乙個資料庫:使用指令sqlite3 mysql

指令1:建立**

create table [表名] [資料型別(約束條件)];

create table mysql(id integer primary key autoincrement,name char not null,number char not null);
我們使用命令.table檢視一下剛才建立好的**,可以看到,mysql**建立完成了

指令2:插入資料到**中

insert into [表名] values [自定義的資料型別];

insert into mysql values(1,'xiaoming','123456');
指令3:檢視**中的資料

selecet * from [表名];

指令4:更新**中的資料

update [表名] set [要修改的內容] where [**中的位置];

指令5:刪除**中的資料,在這之前我們使用命令

insert into mysql values(2,'xiaohong','456789');先加入乙個資料 

delete from [表名] where [**中的位置];

指令6:更改**的名字

alter table [表名] rename to [新的表名];

指令7:刪除**

drop table [表名];

drop table mysql2;
今天先講這麼多,以後有空再補上其他的操作指令。

mongodb資料庫常用指令

詳細安裝看我文章 開啟在bin目錄下mongo.exe來運算元據庫 常用命令 show dbs 檢視所有庫 use blog 使用指定的庫 show collections 檢視所有的文件 db.表名.find 查詢指定文件的資料 db.表名.insert 插入資料 3.將mongodb服務加入到w...

資料庫索引 常用指令

create unique bitmap index index name unique表示唯一索引 on table name column1 asc desc column2 bitmap,建立位圖索引 asc desc express tablespace tablespace name pc...

2018 10 11 資料庫 linux指令

2018.10.11 實習學習記錄 只是記錄每天的學習情況,也是匯報 1.資料庫方面 資料庫有關係型資料庫 非關係型資料庫he鍵值資料庫三種型別。關係型資料庫是資料儲存的傳統標準,根據實體聯絡在表中儲存,資料標準化,通過sql操作。文件資料庫是一種nosql資料庫,將半結構化資料儲存為文件,直接儲存...