資料表集合

2021-09-05 15:26:07 字數 1237 閱讀 9616

整理工作中遇到的各種表問題!

專項例項

1.使用謂詞查詢 ;

2.使用聚合函式查詢

;3.數學函式查詢

;4.使用時間函式查詢

;5.使用萬用字元查詢

;6.使用字串函式查詢;

7.使用游標函式查詢;

8.使用配置函式查詢;

9.使用元資料函式查詢;

10.使用安全函式查尋;

11.使用系統函式查詢;

12.使用系統統計函式查詢;

13.使用文字和圖象函式;

--------------------------

綜合例項

1.學生資訊表 -通過選擇年級和班級得到詳細的學生資訊名單

資料表表中紅色字段表示主鍵

1.學生資訊表(tab_students):

列名資料型別

長度允許空

stu_id  

int4

stu_name

varchar50√

stu_***

varchar50√

stu_birth

datetime8√

stu_birthplace

varchar   50√

2.班級資訊表(tab_classes)

class_id

int4

class_name

varchar50√

3.年級資訊表(tab_grades)

grade_id

int4

grade_name

varchar50√

4.科目表(tab_subject)

subject_id

int4

subject_name

varchar50√

5.學生班級表:(tab_student_class) id

int4

stu_id

int4

class_id

int4

6.班級年級表:(tab_class_grade) id

int4

class_id

int4

grade_id

int4

7.學生成績表(tab_student_score) id

int4

stu_id

int4

subject_id

int4

score

float8√

建立資料表和修改資料表

建立表 sql中建立和刪除資料庫物件的語句被稱為資料定義語言 data definition language,ddl 操作這些物件中資料的語句被稱為資料操作語言 data manipulation language,dml 建立語句屬於ddl,用create table命令 create temp...

庫房資料表

已生成 2015 05 23 08 33 49 伺服器 postgresql 9.4 localhost 5432 資料庫 v9 架構 public 名稱 資料型別 非空?主鍵?預設注釋 autoid integer是是 nextval b warehouse autoid seq regclass...

資料表操作

1 建立資料表 create table if not exists table name column name data type,2 檢視資料表 show tables show tables from mysql 3 檢視資料表結構 show columns from tbl name 4 ...