日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Oracle常用命令的列舉

以下的文章主要是介紹Oracle常用命令,其中包括Oracle數(shù)據(jù)類型,視圖,以及實(shí)例的相關(guān)的介紹,如果你是Oracle常用命令方面的新手,相對(duì)Oracle常用命令的相關(guān)應(yīng)用方面有所了解的話,你就可以點(diǎn)擊以下的文章。

目前成都創(chuàng)新互聯(lián)公司已為千余家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬空間、網(wǎng)站托管維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、呂梁網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。

Oracle數(shù)據(jù)類型:

 
 
 
  1. Create table test1(name char(10),sex char(1));  
  2. Insert into test1 values(‘tomcatt北京’,’f’);  
  3. Create table test2(name nchar(10),sex nchar(1));  
  4. Insert into test2 values(‘tomcatt北京’,’男’);  

刪除表 drop table 表名;

 
 
 
  1. Create table test3(name varchar2(10),sex varchar2(2));  
  2. Insert into test3 values(‘tomcatt北京’,’f’);  

插入值過大

 
 
 
  1. Insert into test3 values(‘tomcat北京’,’f’);  
  2. Create table test4(name varchar2(10),age number(3),
    salary number(8,2));  
  3. Create table test5(name varchar2(10),birth date);  
  4. Insert into test5 values(‘Tom’,’28-2月-08’);  
  5. Insert into test5 values(‘Allen’,sysdate);   

DDL:

創(chuàng)建表

 
 
 
  1. create table scott.test6(  
  2. eid number(10),  
  3. name varchar2(20),  
  4. hiredate date default sysdate,  
  5. salary number(8,2) default 0  
  6. )  

插入數(shù)據(jù)時(shí)若沒有指定hiredate,salary的話則會(huì)取默認(rèn)值

以下就是Oracle常用命令中Oracle數(shù)據(jù)字典的相關(guān)介紹:

Dba-所有方案包含的對(duì)象信息

All-用戶可以訪問的對(duì)象信息

User-用戶方案的對(duì)象信息

 
 
 
  1. Select * from user_tables;  
  2. Select * from all_tables;  

約束:

域完整性約束:not null check

實(shí)體完整性約束:unique primary key

參照完整性約束:foreign key

視圖:

 
 
 
  1. Create or replace view v1(eid,name,salary) as select 
    empno,ename,sal from emp where deptno = 30; 

序列:sequence

 
 
 
  1. Create sequence mysequence1 increment by 1 start
     with 1 nomaxvalue nocycle;  
  2. Insert into test values(mysequence1.nextval,’tom’);  
  3. Create sequence student_sequence start with 1
     increment by 1;  
  4. Insert into student values
    (student_sequence.nextval,’john’);  

表間數(shù)據(jù)拷貝:

 
 
 
  1. Insert into dept1(id,name) select deptno,
    dname from dept; 

實(shí)例(創(chuàng)建表 ID字段自增):

 
 
 
  1. create table test2(id char(10) primary key not null,
     name char(10));  
  2. create sequence test2_sequence increment by 1 start
     with 1 nomaxvalue nocycle;  
  3. insert into test2 values(test2_sequence.nextval,'john');  
  4. insert into test2 values(test2_sequence.nextval,'allen');  
  5. insert into test2 values(test2_sequence.nextval,'candy');  
  6. insert into test2 values(test2_sequence.nextval,'aaaa');  
  7. insert into test2 values(test2_sequence.nextval,'bbbbb');  
  8. insert into test2 values(test2_sequence.nextval,'cccccc');  
  9. insert into test2 values(test2_sequence.nextval,'ddddd');  
  10. insert into test2 values(test2_sequence.nextval,'eeeee');  
  11. insert into test2 values(test2_sequence.nextval,'ggggg');  
  12. insert into test2 values(test2_sequence.nextval,'jowwwwhn');  
  13. insert into test2 values(test2_sequence.nextval,'aaaadd');  
  14. insert into test2 values(test2_sequence.nextval,'ggghhh');  
  15. insert into test2 values(test2_sequence.nextval,'eeettt');  
  16. insert into test2 values(test2_sequence.nextval,'wwwttt');  
  17. select * from test2;  

查看表結(jié)構(gòu)

EDITDATA 表名;

修改表字段:

Alter table 表名 modify(字段名 類型 約束);

alter table test modify (addd varchar2(10) null);

alter table 表名 add(字段名 類型 約束);

alter table test add(age varchar2(5));

上述的相關(guān)內(nèi)容就是對(duì)Oracle常用命令的描述,希望會(huì)給你帶來一些幫助在此方面。

【編輯推薦】

  1. Oracle數(shù)據(jù)庫(kù)中的兩個(gè)進(jìn)程
  2. Oracle reports中實(shí)現(xiàn)報(bào)表的定長(zhǎng)
  3. 執(zhí)行Oracle sql的實(shí)際步驟
  4. Oracle透明網(wǎng)關(guān)如何修改人力數(shù)據(jù)庫(kù)
  5. Oracle透明網(wǎng)關(guān)的內(nèi)容介紹

新聞標(biāo)題:Oracle常用命令的列舉
當(dāng)前路徑:http://www.5511xx.com/article/cojdgpe.html