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

正文內(nèi)容

21天學(xué)通oracle課后答案解析[第三版]-在線瀏覽

2024-08-08 07:24本頁(yè)面
  

【正文】 SQL create tablespace testsize datafile 39。 size 2M 2 autoextend on next 1M 3 / Tablespace created2)創(chuàng)建一個(gè)數(shù)據(jù)表test_tablespace_size(test_data varchar2(100))SQL create table test_tablespace_size(test_data varchar2(100)) tablespace testsize。012345678939。 4 end loop。 6 end。2.刪除表空間testsize,同時(shí)刪除其物理文件。SQL drop tablespace testsize including contents and datafiles。利用exp/imp命令來(lái)實(shí)現(xiàn)該數(shù)據(jù)表的備份/恢復(fù)。SQL create table test_bak(id number)。SQL begin 2 for i in 1..10 loop 3 insert into test_bak values(i)。 5 end。 Commit plete3)利用exp命令備份該表C:\exp system/abc123//(test_bak) file=39。Export: Release Production on 星期六 7月 16 14:51:54 2011Copyright (c) 1982, 2004, Oracle. All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release ProductionWith the Partitioning, OLAP and Data Mining optionsExport done in ZHS16GBK character set and AL16UTF16 NCHAR character setAbout to export specified tables via Conventional Path .... . exporting table TEST_BAK 10 rows exportedExport terminated successfully without warnings..4)在數(shù)據(jù)庫(kù)中刪除表test_bak。 Table dropped5)將表test_bak重新導(dǎo)入數(shù)據(jù)庫(kù)C:\imp system/abc123//(test_bak) file=39。Import: Release Production on 星期六 7月 16 14:54:24 2011Copyright (c) 1982, 2004, Oracle. All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release ProductionWith the Partitioning, OLAP and Data Mining optionsExport file created by EXPORT: via conventional pathimport done in ZHS16GBK character set and AL16UTF16 NCHAR character set. importing SYSTEM39。 ID 1 2 3 4 5 6 7 8 9 10 10 rows selected第6章 約束1.查看表customers的主鍵狀況,如果有,則重建其主鍵,如果沒(méi)有,選擇其中一列創(chuàng)建主鍵。CUSTOMERS39。P39。SQL alter table customers drop primary key。SQL alter table customers drop primary key cascade。SQL alter table customers add primary key(customer_id)。1)創(chuàng)建表country和citySQL create table country(country_id number, country_name varchar2(50))。 Table created2)在表country的country_id列上創(chuàng)建主鍵約束SQL alter table country add primary key(country_id)。 Table altered3.驗(yàn)證所建外鍵關(guān)聯(lián)的作用。SQL insert into city (city_id, city_name, country_id) values (1, 39。, 1)。北京39。2)向表country中添加country_id為1的信息。中國(guó)39。 1 row inserted3)再次為表citry添加城市信息。北京39。 1 row inserted第7章 視圖1.在數(shù)據(jù)庫(kù)中不存在表animals(animal_id, animal_name, animal_type)的情況下,強(qiáng)制創(chuàng)建視圖vw_animal_cat(animal_id, animal_name)。SQL create or replace force view vw_animal_cat(animal_id, animal_name) 2 as 3 select animal_id, animal_name, animal_type from animals where ainmal_type=39。 4 / Warning: View created with pilation errors2.創(chuàng)建一個(gè)物化視圖mv_user_objects(object_type, objectCount),其數(shù)據(jù)來(lái)源于user_objects(owner, count(object_name)),也就是對(duì)每種object類型統(tǒng)計(jì)其object的數(shù)目。而關(guān)系視圖又被當(dāng)做子查詢看待。SQL create table tmp_user_objects as select * from user_objects。 OBJECT_TYPE OBJECT_COUNT FUNCTION 7INDEX 189INDEX PARTITION 31LOB 24PACKAGE 2PACKAGE BODY 2PROCEDURE 9QUEUE 4SEQUENCE 25SYNONYM 8TABLE 197TABLE PARTITION 27TRIGGER 16TYPE 4VIEW 16 15 rows selected3.分別啟用/禁用物化視圖mv_user_objects,來(lái)查看select object_type, count(object_name) object_count from tmp_user_objects的執(zhí)行效率。如果該字符串可以轉(zhuǎn)換為“YYYYMMDD hh24:mi:ss”形式的日期,那么返回為真,否則返回為假。 3 begin 4 d:=to_date (nvl (param, 39。), 39。)。TRUE39。FALSE39。 11 / Function createdto_date (nvl (param, 39。), 39。)用于將字符串參數(shù)param轉(zhuǎn)換為日期時(shí)間型,如果轉(zhuǎn)換成功,則返回“TRUE”;exception則用于處理異常情況,如果發(fā)生異常,函數(shù)將返回 “TRUE”。SQL select is_date(39。) as is_date from dual。abc39。 IS_DATEFALSESQL select is_date(39。) is_date from dual。如果未找到同名學(xué)生,那么打印“無(wú)名為xxx的學(xué)生”。 6 begin 7 select count(*) into student_count from students where student_name=studentName。共找到39。個(gè)名為39。的學(xué)生!39。 10 else 11 (39。 || studentName || 39。)。 13 end。 15 / Procedure created2)嘗試查找名為“張三”的學(xué)生SQL exec find_student(39。)。李四39。 未找到名為李四的學(xué)生! PL/SQL procedure successfully pleted3.利用PL/SQL Developer的Debug功能調(diào)試存儲(chǔ)過(guò)程find_student。2)在右鍵菜單中選擇【Test】3)在參數(shù)欄內(nèi)填入要傳入的參數(shù),并單擊Debug按鈕或者按下F9。從左至右依次為:Run(繼續(xù)執(zhí)行,直至程序結(jié)束,或者下一個(gè)斷點(diǎn))Step into(進(jìn)入存儲(chǔ)過(guò)程/函數(shù)內(nèi)部)Step Over(執(zhí)行當(dāng)前語(yǔ)句,在下一條語(yǔ)句處停止)Step out(跳出當(dāng)前存儲(chǔ)過(guò)程/函數(shù))Run to next exception(執(zhí)行直至下次拋出異常)4)利用這5個(gè)按鈕,即可進(jìn)行存儲(chǔ)過(guò)程的調(diào)試。對(duì)該游標(biāo)依次執(zhí)行打開、獲取、關(guān)閉的步驟來(lái)依次打印獲得的學(xué)生信息。 student_name %type。張三39。 4)獲取游標(biāo)數(shù)據(jù)fetch cu_student_id_name into student_id, student_name。:39。 fetch cu_student_id_name into student_id, student_name。6)關(guān)閉游標(biāo)close cu_student_id_name。 4 5 student_id %type。 7 begin 8 open cu_sutdnet(39。)。 10 11 while cu_sutdnet%found loop 12 (student_id || 39。 || student_name)。 14 end loop。 17 end。通過(guò)修改studentname的值,來(lái)模擬傳入?yún)?shù)功能。 4 begin 5 studentname := 39。 6 for student in (select * from students where student_name = studentname) loop 7 ( || 39。 || 8 )。 10 end。 12 /17:張三18:張三21:張三通過(guò)修改studentname的值,可以查找特定學(xué)生名稱的所有信息。 5 begin 6 open student_cursor for select * from students。 8 end。 3 student students%rowtype。 6 loop 7 fetch student_cursor into student。 9 exit when (student_cursor%notfound)。 11 end。 13 / 王松金瑞鐘君王山劉迪鐘會(huì)張玉柳青胡東商乾王蒙周兵王云劉兵胡玉張潔張三張三王云張軍張三張三 PL/SQL procedure successfully pleted第10章 觸發(fā)器1.現(xiàn)有一個(gè)海量數(shù)據(jù)表products(product_id number, product_name varchar2(120)),代表產(chǎn)品表。由于products數(shù)據(jù)表具有海量數(shù)據(jù)
點(diǎn)擊復(fù)制文檔內(nèi)容
外語(yǔ)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1