Sql 在对象关系数据库中正确填充表
我有一个家庭作业,要求我使用Oracle10gExpress实现一个对象关系数据库来跟踪电话计费数据。我有一个通信的超类,包含调用、文本和数据的子类。我在正确填充这些表时遇到了一个难题,这样我就可以在各个表中找到合适的数据 我的类型和表声明如下:Sql 在对象关系数据库中正确填充表,sql,oracle10g,object-relational-model,Sql,Oracle10g,Object Relational Model,我有一个家庭作业,要求我使用Oracle10gExpress实现一个对象关系数据库来跟踪电话计费数据。我有一个通信的超类,包含调用、文本和数据的子类。我在正确填充这些表时遇到了一个难题,这样我就可以在各个表中找到合适的数据 我的类型和表声明如下: create type CommunicationType as object ( -- column names here ) not final; create type CallType under CommunicationType (
create type CommunicationType as object (
-- column names here
) not final;
create type CallType under CommunicationType (
-- column names here
);
create type TextType under CommunicationType (
-- column names here
);
create type DataType under CommunicationType (
-- column names here
);
create table Communications of CommunicationType (
-- Primary and Foreign key constraints here
);
create table Calls of CallType;
create table Texts of TextType;
create table Datas of DataType;
当我尝试将数据插入其中一个子类时,它的条目不会出现在超类中。同样,如果我将insert
插入到超类中,它不会显示在相应的子类中。例如,insert-into-Calls-values(CallType(--values--))代码>在通信中不显示任何数据。也不将插入通信值(CallType(--values-)代码>显示调用中的任何内容
我做错了什么?您已经创建了四个单独的表。如果在一个表中插入一行,则没有理由期望在另一个表中看到您的行
基于调用类型
、文本类型
和数据类型
的表从通信类型
继承其结构和行为,但这并不意味着数据被复制。我怀疑您可能根本不需要该表通信