Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: The Practical Benefits of the Relational Model

Re: The Practical Benefits of the Relational Model

From: Paul Vernon <paul.vernon_at_ukk.ibmm.comm>
Date: Fri, 4 Oct 2002 17:22:27 +0100
Message-ID: <ankfe5$ppm$1@sp15at20.hursley.ibm.com>


And while I'm here guys, does this information equivalent formulation of the XOR case display the same semantics?

drop table a;
create table a(a integer not null, t CHAR(1) NOT NULL CHECK (t IN ('A', 'B')), primary key(a, t));
insert into a values (1, 'A'), (2, 'A'), (2, 'B'), (3, 'B'), (4, 'B'); drop view v;
create view v as (select distinct a from a ) except (select a from a group by a having count(*) > 1);
select * from v;

And then should this version, now allow inserts? (note the DEFAULT clause)

drop table a;
create table a(a integer not null, t CHAR(1) NOT NULL WITH DEFAULT 'B' CHECK (t IN ('A', 'B')), primary key(a, t)); insert into a values (1, 'A'), (2, 'A'), (2, 'B'), (3, 'B'), (4, 'B'); drop view v;
create view v as (select distinct a from a ) except (select a from a group by a having count(*) > 1);
select * from v;

If so, then I suggest for symmetry, there should be a way of specifying such defaults in the original XOR formulation as well.

Regards
Paul Vernon
Business Intelligence, IBM Global Services Received on Fri Oct 04 2002 - 11:22:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US