freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

華為sybase數(shù)據(jù)庫培訓教材(編輯修改稿)

2025-05-03 02:06 本頁面
 

【文章內容簡介】 QL服務器上供用戶調用執(zhí)行。與一般的SQL語句和批處理語句不同的是,存儲過程是經過預編譯的。當首次運行一個存儲過程時,SQL Server的查詢處理器將對其分析,并產生最終的執(zhí)行方案。由于查詢處理的大部分工作已經完成,所以以后執(zhí)行存儲過程時速度將會很快。執(zhí)行存儲過程時可帶參數(shù)并可調用其他存儲過程,執(zhí)行完畢后返回信息以指示是否成功完成相應操作。存儲過程有兩種:一種是SQL服務器安裝時自動建立的系統(tǒng)存儲過程(系統(tǒng)過程),另一種是用戶自己創(chuàng)建的存儲過程。 系統(tǒng)過程是用于系統(tǒng)管理,并且為用戶提供了從事數(shù)據(jù)庫管理的一種途徑。這些系統(tǒng)過程都是以sp_開頭的,它們都放在master數(shù)據(jù)庫中且隸屬于sa(系統(tǒng)管理員) 。也有很多可以在任一個數(shù)據(jù)庫中運行的系統(tǒng)過程。 常見的系統(tǒng)過程有:Sp_addgroup在當前數(shù)據(jù)庫中建立一個數(shù)據(jù)庫用戶組Sp_addlogin建立一個SQL服務器用戶Sp_adduser在當前數(shù)據(jù)庫中增加一個用戶sp_changegroup改變數(shù)據(jù)庫用戶組Sp_dboption查詢或改變數(shù)據(jù)庫系統(tǒng)設置Sp_dropdevice刪除設備Sp_dropgroup刪除組Sp_droplogin刪除帳號Sp_help查詢數(shù)據(jù)庫對象及所有數(shù)據(jù)庫信息Sp_helpdb查詢數(shù)據(jù)庫信息Sp_helpdevice查詢設備信息Sp_helpgroup查詢組信息Sp_helpindex查詢給定表信息Sp_helpuser查詢用戶信息Sp_lock查詢當前加鎖信息Sp_monitor查詢SQL服務器統(tǒng)計信息Sp_password改變登錄帳號口令Sp_spaceused查詢表中的行數(shù)、數(shù)據(jù)頁數(shù)及空間大小Sp_who查詢當前用戶及過程信息Sp_syntax查詢操作語法Sp_configure配置系統(tǒng)參數(shù)例:sp_helpdbgoname db_size owner dbid created status master MB sa 1 Jan 01, 1900 no options set model MB sa 3 Jan 01, 1900 no options setsybsystemprocs MB sa 4 Oct 24, 1997 trunc log on chkpt tele114 MB sa 5 Oct 24, 1997 select into/bulkcopy, trunc log on chkpt tempdb MB sa 2 May 05, 1998 select into/bulkcopy (0 rows affected, return status = 0)例:sp_monitorgolast_run current_run seconds May 5 1998 4:09PM May 5 1998 4:13PM 224 (0 rows affected) cpu_busy io_busy idle 17(1)0% 5(0)0% 923(223)99% (0 rows affected) packets_received packets_sent packet_errors 21(9) 51(23) 0(0) (0 rows affected) total_read total_write total_errors connections 947(1) 595(113) 0(0) 3(1) (0 rows affected, return status = 0)(5)觸發(fā)器(Triggers) 觸發(fā)器是一種特殊的存儲過程,用來維護不同表中的相關數(shù)據(jù)的一致性。當在一張表中插入、刪除和修改數(shù)據(jù)時,觸發(fā)器就會觸發(fā)另一個存儲過程,從而保持數(shù)據(jù)的一致性。(6)缺省與規(guī)則(Defaults and rules) 缺省是在數(shù)據(jù)錄入時,若用戶沒有輸入數(shù)據(jù),SQL Server自動輸入的值。規(guī)則是可以理解為對數(shù)據(jù)庫、某一列、某用戶數(shù)據(jù)類型的限制。第3章 SQL 查詢語言 SQL不僅包括查詢數(shù)據(jù)的有關命令,還包括創(chuàng)建數(shù)據(jù)庫及其對象,增、刪、改數(shù)據(jù)等功能。分別定義為數(shù)據(jù)查詢語言,數(shù)據(jù)定義語言及數(shù)據(jù)操作語言。這里先介紹數(shù)據(jù)查詢語言。其基本句法為: Select select_list from table_list where search_conditions 簡單查詢A、選擇若干列 Select expression [,expression]... From table_listB、選擇若干行查出電話號碼以415到頭的記錄Select * from code_1th where tel like 39。415%39。查詢中消除值重復的行Select distinct tel from code_1th 對Text 和 char 可用 like ,其中可用通配符‘%’及‘’,分別代表多個字符和單個字符。其他常用查詢條件有:(出text類型除外)大小比較=、=、=、!=、!、!范圍確定between exp1 and exp2 /net between exp1 and exp2列表或集合in (exp1[,exp2,[...]]) not in (...)謂詞like 多重條件and or not 連接查詢A、等值連接和不等值連接:通過‘=’來比較兩個表之間的數(shù)據(jù)時,稱為等值連接;而通過其他比較符時,稱為不等值連接等值連接:Select * from publishers, authors where =不等值連接:B、自然連接: 在連接的目標列中相同名的列只保留一個Select , , authors.* From publishers, authors where = 子查詢A、表達式子查詢Select au_lname, au_fname from authors where city=(select city from publishers where pub_name=abcde) 可以使用一切大小比較操作符;在操作符和子查詢之間可以使用All 或any。B、定謂詞子查詢Select pub_name from publishers from publishers Where pub_id in (select pub_id from titles where type=39。abcde39。)C、相關查詢相關查詢即嵌套查詢依賴于外部父查詢的值,嵌套查詢要重復執(zhí)行若干次。Select distinct from titles t1 Where in ( select from titles t2 where !=) 集函數(shù)、分組與排序A、對查詢結果進行聚集處理聚集函數(shù): Sum([all|distinct] expression),avg([all|distinct] exoression) ,Count([all|distinct]expression), count(*), max(expression), min(expression) Select count(*) from titlesB、用Group by 和 having 子句對查詢結果分組Select type ,avg(advance), sum(total_sales) from titles group by type Select type from titles group by type having count(*) 1Having 類似于where , 但where 不能用聚集函數(shù)。C、用Order by 對查詢結果進行排序Select type ,avg(price) from titles group by type order by avg(price)D、Compute 子句完成基于每一組中的值的聚集運算,聚集值作為一個新行出現(xiàn)在查詢結果中。Select type ,price advance from titles order by type pute sum(price), sum(advance) by type第4章 數(shù)據(jù)庫、數(shù)據(jù)庫對象的增、刪、改 數(shù)據(jù)庫打開數(shù)據(jù)庫 Use tele114創(chuàng)建數(shù)據(jù)庫。擁有創(chuàng)建數(shù)據(jù)庫權利的用戶可以創(chuàng)建自己的數(shù)據(jù)庫。CREATE DATABASE tele114ON tele114_def01=10,tele114_run01=200,tele114_idx01=200 LOG ON tele114_log01=80刪除數(shù)據(jù)庫 Drop database tele114修改數(shù)據(jù)庫 Alter database tele114 on tele114_run02=100, tele114_idx02=100 表建表 create table spec_code ( No tinyint not null, /*特編號(099)*/ Name varchar(50) null, /*名稱*/ Addr varchar(50) null, /*地址*/ Tel varchar(8) null, /*電話號碼*/ StaffNo varchar(4) not null /*錄入員工號*/ )on segrun /*將表放在segrun段上*/刪除表Drop tabel tele114_1th修改表,在表中增加新的列(用這個命令增加的列必須允許null值)Alter table friends_etc add country varchar(20 ) null 表級或列級約束Create table my_publishers (pub_id char(4),Pub_name carchar(40).Constraint my_chk_constraintCheck (pub_id in (39。138939。,39。073639。,39。087739。))Or (pub_name not like 39。bad news books39。))指定默認值Create table ny_titles(title_id char(6t),Title varchar(80),Price money default null,Total_sales int default (0))指定Unique 和primary key 約束Primary key 不允許空值,常用來產生唯一的聚集索引,unique 允許空值,常用來產生唯一的非聚集索引Create table my_sales(stor_id
點擊復制文檔內容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1