資料庫基礎語法 CUDR

2021-10-08 20:56:19 字數 910 閱讀 9581

creat(建立)、read(讀取)、update(修改)、delete(刪除)

1.新增資料

insert into 表名 values(值)

insert into stu values(『001』,『張三』,『陝西省』,『96』) ;

2.刪除資料

delete from 表名 where 條件

delete from stu where score=『96』;

3.修改資料

update 表名 set 要修改的內容 where 條件

update stu set name=『張三』 where score=『96』;

4.讀取資料

讀取所有

select * from stu;

條件查詢

select * from stu where name=『張三』;

多條件查詢

select * from stu where name=『張三』 or score=『96』

select * from stu where name=『張三』 and score=『96』

模糊查詢

查詢名字含有『三』的資料

select * from stu where name like 『%三%』;

查詢名字第二個字是『三』的資料

select * from stu where name like 『_三』;

排序查詢(預設公升序)

select * from stu order by score

asc(公升序) desc(降序)

select * from stu order by score desc

MySQL資料庫基礎語法(一)

mysql資料庫的基本操作 增刪改查 以及一些高階操作 檢視,觸發器,函式,儲存過程等 和c c 操作mysql資料庫 資料庫 database,儲存資料的倉庫 資料庫 高效的儲存和處理資料的介質 介質主要是兩種 磁碟和記憶體 資料庫基於儲存介質的不同 進行了分類,分為兩類 關係型資料庫 sql 和...

資料庫SQL 基礎語法(一)

資料庫結構 1.服務端 用於接收並處理其它程式發出的請求的程式 軟體 或者是安裝此類程式的裝置 計算機 2.客戶端 向伺服器發出請求的程式 軟體 或者是安裝此類程式的裝置 計算機 3.庫 就是一堆表組成的資料集合 4.表 table 類似excel,由行和列組成的二維表喪。5.欄位 表的列 垂直方向...

clickhouse資料庫之基礎語法

一 clickhouse資料庫發展歷史 clickhouse是俄羅斯yandex在2016年6月15日開源的資料庫,是列式儲存,該資料庫效能極高,查詢效率極快,較其他同類資料庫速度提公升100 1000倍。二 clickhouse的特點 uint8,uint16,uint32,uint64,int8...