| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Anybody for Automated Comparative Normal Form?
Tony Andrews wrote:
> Kenneth Downs wrote:
>> This brings the problem back to what I have called "arbitrary
>> in recent weeks, but which should probably be called "comparative >> constraints", because this is what they keep turning into. It should
>> possible to demonstrate that by using automation, one can reduce any >> arbitrary constraint to a comparison constraint.
This is correct but incomplete. The goal actually is to reduce the element <violates constraint> to something that can be specified without using code. Put another way, you are not allowed to automate a column by defining a SQL statement or expression for it. The only tools available are the fundamental operations of addition, multiplication and so forth (also functions like coalesce, sin, etc.), aggregation functions, and pulls (where you fetch price from the items table).
Values of arbitrary complexity can be generated through composition. Extended_price = price * qty, and line_discount = extended_price * line_pct, and line_final = extended_price - line_discount. Then the order header table has Line_total = SUM(details.line_final). Then the customers table has Orders_total = SUM(orders.order_final) and Invoice_total = SUM(invoices.invoice_final), and Total_exposure = Orders_total + invoice_total. Now you define a constraint that total_exposure may not exceed credit_limit.
It is extremely important in this model not to confuse the *implementation* of these definitions with the *form* of these definitions. The value I have found in this form is that the definition of all items against real tables means:
Through composition we seek to eliminate <violates constraint> and reduce all arbitrary constraints to comparison constraints, where the individual elements themselves have been built up through the definition of simple operations on highly normalized tables.
-- Kenneth Downs <?php echo "sig block. i'm hip"; ?>Received on Fri Nov 19 2004 - 07:50:37 CST
![]() |
![]() |