mysql的定義 MySQL定義

2021-10-17 16:46:22 字數 669 閱讀 8397

什麼是sql:sql是結構化查詢語言。

什麼是資料庫:資料庫是用來儲存資料的。

關聯式資料庫:多張表之間的關係。

關聯式資料庫包含表:表名、列、主鍵,通過相應的關係列來產生連線關係。

資料庫與資料倉儲:資料庫是用來做交易(transaction),資料倉儲是用來做分析(analytics)。資料倉儲的作用在於:資料結構是為了分析和查詢的便利;唯讀優化的資料庫(不需要寫入多快,只需要大量資料、複雜查詢足夠快)。

資料庫(資料庫管理系統) 比較流行的有:mysql, oracle, sqlserver等。

資料倉儲 比較流行的有:aws redshift, greenplum, hive等。

sql分類:ddl資料定義語言(create/drop/alter)、dml資料操縱語言(insert/delete/select/update)、dcl資料控制語言(commit/rollback/crant)。

sql書寫規則:sql語句以英文分號(;)結尾、sql語句不區分關鍵字的大小寫、輸入符號只能使用英文(如分號;逗號,)。

eg:create table student(學號 varchar(20), 姓名 varchar(20) not null, 出生日期 varchar(20) not null, 性別 varchar(20) not null, primary key(學號));

mysql定義條件 MySQL定義條件

在開發過程中,經常需要對特定的條件進行處理,這些條件可以聯絡到錯誤以及子程式中的一般流程控制 定義條件 是指事先定義,程式執行過程中遇到的問題 處理程式定義了在遇到這些問題時,應當採取的處理方式,並且,保證儲存過程在遇到警告或錯誤時,能繼續執行 定義條件 在編寫儲存過程中,使用declare語句 語...

mysql資料定義 Mysql 資料定義

1 基本操作 刪除資料元 delete from student where name qiang 條件刪除 delete from student 清空 更新資料 update student set height 180 where name hong update student set ag...

mysql資料定義 Mysql 資料定義

1 基本操作 刪除資料元 delete from student where name qiang 條件刪除 delete from student 清空 更新資料 update student set height 180 where name hong update student set ag...