Re: Duplicate columns in tables created by Designer 2000

From: Archana Agarwal <aagarwa2_at_osf1.gmu.edu>
Date: 1996/08/15
Message-ID: <4uvf4f$clp_at_portal.gmu.edu>#1/1


Leonard Vanek (len_at_cmic.ca) wrote:
: Does anyone know how to eliminate duplicate key columns in
: tables generated by Designer 2000 from entities and foriegn
: key relationships?
 

: The following example illustrates the problem.
 

: We have two entities, "SKU" and "Warehouse". These both have as
: part of their primary UID a certain relationship (e.g. "belongs to
: Company"). Another entity, "Stock Item", has as its primary UID
: relations to "SKU" and "Warehouse". When the table is generated
: for "Stock Item", it will have four key columns -- SKU_Number,
: Warehouse_ID, and TWO COPIES OF COMPANY_CODE! How do we
: eliminate the redundant column?

I believe you are having a design problem, since I do not have detailed data about entities, let me guess!!

Since SKU and Warehouse have common Company no., you can move them to super/sub entity set, plus why you are putting company no. manually in SKU and Warehouse, as data design wizard will create this column for you in both the entities. If you follow Super/Sub path then you may have to use system generated id (sequence), depending upon the conditions you have.

: This problem also creeps in with foriegn keys that are not part of
: the primary key. For example, an entity called "Buyer" may also
: depend on "Company" and may be referenced as a foreign key by
: "Warehouse". Then the "Warehouse" table will have a COMPANY_CODE
: column in its primary key and have another column containing
: COMPANY_CODE that is part of the foreign key specifying the
: buyer for that warehouse.

This problem with buyer/Warehouse will also be solved if you do not have company name added manually in buyers and Warehouse.

: This looks like a problem with ER modelling tools in general, but
: I need a solution that can be implemented easily within D2K.

ER models data what you have inputed in it, if you want to quality check your diagrams then run the repository reports tools. By running these tools about relationships, entities, tables one can figure out all the errors during the design phase before going for SQl DDL generation.

I hope this helps.. you can contact me at the email given below.

Pankaj
pgarg_at_po7.ahcpr.gov

: Leonard Vanek
: len_at_cmic.ca
  Received on Thu Aug 15 1996 - 00:00:00 CEST

Original text of this message