欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

表、視圖、索引的創建、修改、刪除操作等

系統 2001 0

一、表的創建

1、創建表

create if not exists ?table student(StuID integer);

2、 創建帶有缺省值的數據表:

create table if not exists ?schoolTable(schID integer default 0, schName varchar default 'hz');

3、if not exists 使用

?如果已經存在表名、視圖名和索引名,那么本次創建操作將失敗。加上"IF NOT EXISTS"從句,那么本次創建操作將不會有任何影響.

create table if not exists studentTest(StuID integer);

4、primary key

create table if not exists ?studenttable (stuid integer primary key asc); 創建主鍵

create table if not exists?studenttable2 (stuid integer,stuName varchar, primary key(stuid,stuName)); 創建聯合主鍵

4 unique約束

create table if not exists?sutTest(stuID integer unique); 創建唯一性約束

5 check約束

create table if not exists?sutTest2(stuID integer, ID integer, check(stuID > 0 and ID <0));

?

二、表的修改

1、修改表名

alter table sutTest rename to stutest;

2、向表中添加新列

alter table??stuTest add column stuName varchar;

?

三、表的刪除

drop table if exists stuTest 如果某個表被刪除了,那么與之相關的索引和觸發器也會被隨之刪除。?

?

四、創建視圖

1、創建簡單視圖

create view if not exists View_Corporate as select * from corporate where corid > 1

2、創建臨時視圖

create temp view tempView_Corporate as select * from corporate where corid > 1

?

五、刪除視圖

drop view if exists View_Corporate;

?

六、索引的創建

1、該索引基于corporate表的corID字段。

create index cor_index on corporate(corID);

2、該索引基于corporate表的corID,corname字段,,并且指定每個字段的排序規則

create index cor_index2 on corporate(corID asc, corName desc);

3、創建唯一索引

create unique index cor_index3 on corporate(corID asc, corName desc);

?

七、刪除索引

drop index if exists cor_index3;

?

八、重建索引 reindex;

?重建索引用于刪除已經存在的索引,同時基于其原有的規則重建該索引。

九、數據分析 analyze;

十、數據清理 vacuum;

表、視圖、索引的創建、修改、刪除操作等


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 精品视频在线观看 | 午夜精品一区二区三区在线视频 | 久草视频在线观 | 亚洲一级成人 | 欧美日韩一区精品 | 欧美激情人成日本在线视频 | 91观看| 日韩毛片欧美一级a网站 | 亚洲黄色在线网站 | 懂色中文一区二区三区在线视频 | 精品久久久爽爽久久久AV | 亚洲人成亚洲人成在线观看 | 亚洲免费一级视频 | 日韩欧美不卡在线 | 亚洲综合一二三区 | 黑人xxx视频 | 久久精品99久久 | 午夜黄色影院 | 在线播放一区 | 小草社区影院 | 97国产精品视频人人做人人爱 | 草草线在成人免费视频 | 五月天色网址 | 成人做爽爽爽爽免费国产软件 | 欧美视频在线一区二区三区 | 日韩中文字幕一区二区三区 | 国产二区三区视频 | 国产美女自卫慰视频福利 | 亚洲天堂视频在线观看免费 | 色屁屁影院网站入口 | 欧美日韩一区二区高清视 | 爱爱综合网 | 色喜亚洲美女沟沟炮交国模 | 日韩不卡视频在线 | 天天操天天爱天天干 | 五月亚洲综合 | 亚卅毛片 | 欧美国产免费 | 成人午夜18免费看 | 亚洲欧美一区二区三区久本道 | 污视频导航|