自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle常用命令的列舉

數(shù)據(jù)庫 Oracle
在Oracle常用命令中有很多的命令式,就是這些的相關(guān)命令才使Oracle常用命令在實際的操作中變得更加的靈活,下面就是相關(guān)內(nèi)容的描述。

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

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ù)時若沒有指定hiredate,salary的話則會取默認值

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

Dba-所有方案包含的對象信息

All-用戶可以訪問的對象信息

User-用戶方案的對象信息

 

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

 

約束:

域完整性約束:not null check

實體完整性約束: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; 

實例(創(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)容就是對Oracle常用命令的描述,希望會給你帶來一些幫助在此方面。

【編輯推薦】

  1. Oracle數(shù)據(jù)庫中的兩個進程
  2. Oracle reports中實現(xiàn)報表的定長
  3. 執(zhí)行Oracle sql的實際步驟
  4. Oracle透明網(wǎng)關(guān)如何修改人力數(shù)據(jù)庫
  5. Oracle透明網(wǎng)關(guān)的內(nèi)容介紹
責任編輯:佚名 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-04-02 17:37:15

Oracle rman

2010-04-02 17:51:10

Oracle back

2014-07-25 10:55:36

Linux命令

2011-03-16 10:07:00

2014-01-02 09:57:56

PostgreSQL命令

2011-01-19 17:00:09

Postfix常用命令

2020-09-28 15:14:31

Linux常用命令實用命令

2022-05-05 08:08:55

Podman命令Linux

2010-04-09 17:25:05

Oracle 10G

2010-03-29 10:16:39

CentOS常用命令

2011-08-15 22:51:34

Oraclerman

2010-03-24 17:44:58

CentOS常用命令

2014-08-18 09:49:46

Linux

2009-12-22 14:47:24

Linux常用命令

2010-04-01 18:10:32

CentOS常用命令

2010-05-28 18:28:51

MySQL常用命令

2011-03-15 09:59:57

2015-07-22 17:32:22

mysql常用命令

2015-07-28 10:21:23

git命令

2010-05-25 11:40:12

MySQL 常用命令
點贊
收藏

51CTO技術(shù)棧公眾號