employees 表
employee_id number not null,primary key
emp_name varchar(30)
mgr_id number Reference employee_id column
number Reference employee_id column 怎么解释呢??谢谢
employee_id number not null,primary key
emp_name varchar(30)
mgr_id number Reference employee_id column
number Reference employee_id column 怎么解释呢??谢谢
解决方案 »
- 隆重推出超方便实用的国产免费的 Oracle 开发工具 - Oracle SQL Handler (免装客户端,双语界面,跨平台能运行于LINUX及MAC)
- 多表查询
- oracle 安装问题,请各位大侠帮帮忙啊
- oracle 递归查询 奇怪的问题!
- 通过一个SQL查询出所有class为1的记录,并查出:每个Number相同的所有记录数量,数据库是ORACLE
- oracle将一张表中的多行合成一行,哪位好心的大哥帮忙,小的在线急用
- 怎么向同一列中添加数据?
- 如何实现远程连接?
- 多个表 union all ,如何按以大到小的排序
- 高手近来看看,问题比较的复杂,高分送上
- 业务变更,两种sql处理方式 哪个更优化
- 请问一下在VS2005里调用存储过程,存储过程的有一个变量是游标,请问这个游标在VC里该传入什么参数呢?
create table emp3 (employee_id number primary key,
emp_name varchar2(30),
mgr_id number references emp3(employee_id));insert into emp3 values(1, 'Adom', null);
1 row created.
insert into emp3 values(2, 'Bob', 1);
1 row created.
insert into emp3 values(3, 'Cindy', 3);
1 row created.
insert into emp3 values(4, 'Dog', 5);
ORA-02291: integrity constraint (HR.SYS_C0019505) violated - parent key not found
insert into emp3 values(4, 'Dog', 4);
1 row created.
这个语句怎么解释呢?谢谢
意思是说,mgr_id引用自己表的employee_id字段的值,可以为null,但如果不为null时,其值必须在employee_id中找到,否则报ORA-02291: integrity constraint (...) violated - parent key not found
1 row created.
insert into emp3 values(2, 'Bob', 1);
1 row created.
insert into emp3 values(3, 'm', 2);
1 row created.
insert into emp3 values(2, 'b', 3);
1 row created. 只允许这样的数据才能插入成功
你英语好的话可以看看Oracle的官方文档:
A synonym is an alias for any table, view, materialized view, sequence, procedure, function, package, type, Java class schema object, user-defined object type, or another synonym. Because a synonym is simply an alias, it requires no storage other than its definition in the data dictionary.Synonyms are often used for security and convenience. For example, they can do the following:•Mask the name and owner of an object•Provide location transparency for remote objects of a distributed database•Simplify SQL statements for database users•Enable restricted access similar to specialized views when exercising fine-grained access controlhttp://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT711
看文档看不大懂