Entity-Relation Model for Teradata Query

Database
Enthusiast

Entity-Relation Model for Teradata Query

Good afternoon

Is there any command (Preferred) or any tool to know the relations among specified tables or views

I.E. Parent table  record (Product) has -> (child record tables) Services and so on.

dont know how Teradata  if handles the same concept primary - foreign key

The above requirement is in order to see a wide knowlede of related tables for practicing Embedded inner/Outer Joins

Id appreciate your help

3 REPLIES
Enthusiast

Re: Entity-Relation Model for Teradata Query

During the data modelling process, the RI  i.e the primary and foriegn key relations are defined based on the business requirement and this process is called the LDM(Logical data model).This will be an input to PDM(Physical data model) wherein the Primary Index is defined.ERWIN is one of the data modelling tool.

In teradata the data distribution,data retrieval and joins are all based on the primary index.The primary key can be a PI  but not necessarily.In the create DDL we do not normally specify the primary key but it can be defined using CONSTRAINT as below

Primary key constraint can be established at column level & table level

CREATE TABLE DB.EMPLOYEE

(

 EMP INTEGER NOT NULL

  CONSTRAINT EMPPK PRIMARY KEY

,DEPT INTEGER CONSTRAINT REF_1 REFERENCE DEPARTMENT(DEPT)

);

Foriegn key constraint can be established at table level only

CREATE TABLE DB.EMPLOYEE

(

 EMP INTEGER

,DEPT INTEGER

,CONSTRAINT EMPPK PRIMARY KEY(EMP)

,CONSTRAINT REF_1 FORIEGN KEY(DEPT) REFERENCES DEPARTMENT(DEPT)

);

Enthusiast

Re: Entity-Relation Model for Teradata Query

Hi

how can we represent PI on the erwin tool if we select teradata for the database. when foing forward engineering how do we ensure that PIs are created and not PK.

Regards

Srividhya

Junior Supporter

Re: Entity-Relation Model for Teradata Query

Srividhya

You must define both the PK and the PI on the 'Indexes' window for the table.

You can define the PK and uncheck the 'generate' check box (forward engineering won't create it). Then you can create the PI as another index and set it as 'primary' in the options tab. Additionaly, you can mark it 'phisical only'.

HTH.

Cheers.

Carlos.