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

Oracle常用的命令中Oracl的相關(guān)數(shù)據(jù)類型列舉

數(shù)據(jù)庫 Oracle
Oracle常用的命令中Oracl的相關(guān)數(shù)據(jù)類型有很多種,本文主要向你介紹的是經(jīng)常使用到的一些類型,例如,Oracle常用命令數(shù)據(jù)字典就是經(jīng)常被使用到的。

以下的文章主要是介紹Oracle常用的命令中Oracl的相關(guān)數(shù)據(jù)類型,本文也涉及到一些相關(guān)的實際應(yīng)用代碼,以代碼的方式來引出Oracle常用的命令中Oracl的相關(guān)數(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);  
  6. 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的話則會取默認(rèn)值

Oracle常用命令數(shù)據(jù)字典:

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’);  

 

Oracle常用命令表間數(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(字段名 類型 約束);

 

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

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

 

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

【編輯推薦】

  1. Oracle應(yīng)用的程序開發(fā)趨于向Web的緣由
  2. Oracle RAC中錯誤觀點出現(xiàn)的原因
  3. Oracle客戶關(guān)系管理論壇的內(nèi)容簡介
  4. Oracle常用命令的列舉
  5. Oracle常用的命令如何查看表的結(jié)構(gòu)
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2010-04-07 11:21:28

Oracle常用命令

2010-04-23 14:08:11

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

2010-07-20 15:54:02

SQL Server數(shù)

2010-07-26 14:21:25

SQL Server數(shù)

2010-04-27 11:03:39

Oracle Java

2010-08-26 17:16:19

Infobright

2010-04-13 15:24:25

Oracle維護常用語

2010-10-27 14:52:04

ORACLE數(shù)據(jù)類型

2010-06-10 10:06:01

MySQL數(shù)據(jù)類型

2022-07-03 06:10:15

MySQL數(shù)據(jù)庫

2010-03-31 18:56:56

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

2010-05-31 10:35:12

MySQL數(shù)據(jù)類型

2010-04-08 14:23:14

Oracle服務(wù)

2010-10-19 15:54:38

sql server創(chuàng)

2011-08-24 13:23:35

Access 2010

2009-11-17 10:01:11

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

2010-03-30 16:33:55

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

2022-10-27 20:42:04

JavaScripJava編程語言

2010-04-01 10:55:48

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

2025-01-06 05:10:00

Python數(shù)據(jù)類型編程
點贊
收藏

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