Foreign keys of a logical Table

Hi all

I want to know in what scenarios, we create the foreign key of a logical Table. Once we have create the foreign key for the logical table, this means he automatically substitute if joins are here.


Physical table A, B (without physical joins)

Logic table A, B (B (Sun)--> (Fact) A logical join)

created the foreign key in the logical table A with b. (A.1 = B.1)

The RPD will generate sql with A.1 = B.1 join condition for the reports.

I tried to create the logical foreign key for table logical, I couldn't see any option from the table. Here is his
http://Tinypic.com/r/jq1gkz/6


Thank you

Virat

In general when we go to the complex joins in the physical layer, we opt for logical foreign key joins in layer MDB, best examples is SCD Type II.

Physical table A, B (without physical joins)
--> You must have a physical join so that it can be override by layer MDB

created the foreign key in the logical table A with b. (A.1 = B.1) the RPD will generate sql with A.1 = B.1 join condition for the reports.
--> Yes, you can see this join in the physical BI query.

I tried to create the logical foreign key for table logical, I couldn't see any option from the table. Here is his
--> 2 cases: 1) you must remove existing logical joins 2) you could not have involved physical layer.

Hope this helps
Let me know for questions

Published by: Srini VIEREN on 18 January 2013 13:29

BTW: You got a very good reputation, why don't update you your profile to see your name instead of a number

Published by: Srini VIEREN on 18 January 2013 13:29

Tags: Business Intelligence

Similar Questions

  • Administration tool of BI - physical foreign key corresponding MDB logical join?

    Hello

    Can anyone explain why when you create a join (physical foreign key) in the physical layer for example

    Then view the corresponding logic join in the MDB layer it is the other way round? that is the "one" table in appears on the right and the "an array much ' on the left.

    It seems fair that logically, I would have expected the "one" table will appear on the left and the "table several" on the right as it does in the physical layer?

    Kind regards

    Tom Rowe

    Hello

    Thanks for your answer Yes, indeed the cardinality is the important thing here, and the query gives the expected results. However also personally find this confusion not to mention that I have since found it also seems to be incompatible, that is. some logical joins are shown round track that I know and others aren't, I redefine the joins that do not have the table 'a' appearing on the left and the "a table much" appearing on the left. This also has the advantage of showing all the table 1 in the form of tables table 2 as fact in the Manager of joint tables and dimension.

    Appears not to be a minor bug / irritation me may therefore raise a SR with Oracle.

    Kind regards

    Tom Rowe.

  • How can I make sure that changes in a primary key (in the parent table) would also appear directly in the FOREIGN KEY in the child table?

    Forgive my question. I am very new to Oracle.

    How can I make sure that changes in the key primary supplier_id (concerning the supplier table) would also appear directly in the FOREIGN KEY (supplier_id) in the products table?

    Is that not all the primary key and FOREIGN KEY on?

    My paintings:

    I created 2 tables and connect to apply in the data base referential integrity, as I learned.

    CREATE TABLE - parent provider

    (the numeric (10) of supplier_id not null,)

    supplier_name varchar2 (50) not null,

    Contact_Name varchar2 (50).

    CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)

    );

    CREATE TABLE - child products

    (the numeric (10) of product_id not null,)

    supplier_id numeric (10) not null,

    CONSTRAINT fk_supplier

    FOREIGN KEY (supplier_id)

    REFERENCES beg (supplier_id)

    );

    I inserted the following text:

    INSERT INTO provider

    (supplier_id, supplier_name, contact_name)

    VALUES

    (5000, 'Apple', 'first name');

    I expect that the supplier_id (5000) to the provider of the table also appears in the products table under key supplier_id having the same value which is 5000. But this does not happen.

    How to get there?

    Thanks in advance!

    Hello

    What is a foreign key in Oracle?

    A foreign key is a way to ensure referential integrity in your Oracle database. A foreign key means that the values of a table must appear also in another table.

    Ok!??

    What is now the right way to implement referential integrity in your Oracle database that the values of a table must also be included in another table?

    A foreign key referential integrity indeed enfore in ensuring that the value in the child table must have a corresponding parent key (otherwise you will encounter an error, as evidenced by "SomeoneElse"). However, it will never automatically insert a row in the other table.

    If you are looking for a solution that automatically inserts a record in the other table, maybe you should go for triggers:

    See:

  • Delete data table Parent and child data automatically delete or the value null in the foreign key of the child table.

    Oracle 10g

    Hi gurus

    I test_mst table that has a primary key test_mst.test_id, I detail table test_dtl which has test_dtl.test_id of foreign key, now I have that I want to use the delete statement in test_mst then it should also remove the constraint of her child or null in test_dtl.test_id, can again do in oracle 10g?

    Thanks in advance

    Hi Mit.

    example of cascade

    create table bill(
      bill_id number not null primary key
    )
    ;
    create table bill_item(
      bill_item_id number not null primary key,
      bill_id number references bill(bill_id) on delete cascade
    )
    ;
    insert into bill values (1)
    ;
    insert into bill_item values (1, 1)
    ;
    delete bill
    ;
    select * from bill_item
    ;
    drop table bill_item purge
    ;
    drop table bill purge
    ;
    
    Table BILL created.
    Table BILL_ITEM created.
    1 row inserted.
    1 row inserted.
    1 row deleted.
    
    no rows selected
    
    Table BILL_ITEM dropped.
    Table BILL dropped.
    

    exemplary null

    create table employer(
      employer_id number not null primary key
    )
    ;
    create table employee(
      employee_id number not null primary key,
      employer_id number references employer(employer_id) on delete set null
    )
    ;
    insert into employer values (1)
    ;
    insert into employee values (1, 1)
    ;
    delete employer
    ;
    select * from employee
    ;
    drop table employee purge
    ;
    drop table employer purge
    ;
    
    Table EMPLOYER created.
    Table EMPLOYEE created.
    1 row inserted.
    1 row inserted.
    1 row deleted.
    
                                EMPLOYEE_ID                             EMPLOYER_ID
    --------------------------------------- ---------------------------------------
                                          1                                       
    
    Table EMPLOYEE dropped.
    Table EMPLOYER dropped.
    
  • Several foreign key joins between two tables

    Hello

    I have a question about the creation of a repository.

    I have a date and a fact dimension. The fact table has about 10 columns in foreign key to the date Dimension.

    In this case I should create 10 aliases to create joins in the physical layer and MDB or y at - it another way to handle this situation.

    I ask this question because 10 aliases can get very confusing for me at the later stage of time when creating reports.

    With the help of OBIEE 10.1.3

    If you want to see in the industry as
    End date, start date, date etc. nearby
    you need to create 10 aliases for this purpose in the physical layer, make them drag in MDB and model, and then drag to the area of topic

    Score pls correct/good

  • How to create a foreign key constraint on a table nested column

    Dear Experts,
    I create 2 tables using the object type. the VESSEL_PARAM table contains the list of the parameters allowed.
    The table VESSEL_TYPE containe single item we list some parameters.

    On this table, I love the column VESSEL_PARAM table VESSEL_PARAM to check if the settings are and the reference value is allowed.
    How to create a foreign key?
    Here my script that generates this runtime error: 00904. 00000 - '% s: invalid identifier' on this line

    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (NAME, DATA_VALUE)
    REFERENCES VESSEL_PARAM (PARAM_NAME, LIST_PARAM_VALUE. DATA_VALUE)
    CREATE OR REPLACE TYPE OBJ_PARAM_VALUE AS OBJECT 
    ( 
      DATA_VALUE  VARCHAR2(20)
     ,DESCRIPTION VARCHAR2(125)
    ) NOT FINAL;
    /
    
    CREATE OR REPLACE TYPE LIST_PARAM_VALUE AS TABLE OF OBJ_PARAM_VALUE;
    /
    
    -- derive object subtype from object supertype
    CREATE OR REPLACE TYPE OBJ_PARAM_NAME UNDER OBJ_PARAM_VALUE (
      NAME VARCHAR2(30)
    )NOT FINAL;
    /
    
    CREATE OR REPLACE TYPE LIST_PARAM_NAME AS TABLE OF OBJ_PARAM_NAME;
    /
    
    Prompt create table VESSEL_PARAM;
    CREATE TABLE VESSEL_PARAM (
       PARAM_NAME   VARCHAR2(20) NOT NULL
      ,PARAM_DESC   VARCHAR2(125)
      ,PARAM_VALUE  LIST_PARAM_VALUE
      ,CONSTRAINT PK_VESSEL_PARAM PRIMARY KEY (PARAM_NAME)
    ) 
    NESTED TABLE PARAM_VALUE STORE AS PARAM_VALUE_TAB
    TABLESPACE CMS_ADMDATA;
    /
    ALTER TABLE PARAM_VALUE_TAB ADD CONSTRAINT UN_PARAM_VALUE_TAB UNIQUE (DATA_VALUE);
    /
    SHOW ERROR;
    
    Prompt create table CMS_ADM.VESSEL_TYPE;
    CREATE TABLE CMS_ADM.VESSEL_TYPE (
      VESSEL_TYPE  VARCHAR2(20) NOT NULL
     ,VESSEL_DESC  VARCHAR2(125)
     ,VESSEL_PARAM LIST_PARAM_NAME
     ,CONSTRAINT PK_VESSEL_TYPE PRIMARY KEY (VESSEL_TYPE)
    -- ,CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (VESSEL_PARAM) 
    --        REFERENCES VESSEL_PARAM (PARAM_NAME)
    ) 
    NESTED TABLE VESSEL_PARAM STORE AS VESSEL_PARAM_TAB
    TABLESPACE CMS_ADMDATA;
    /
    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT UN_VESSEL_PARAM_TAB UNIQUE (NAME);
    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (NAME,DATA_VALUE) 
            REFERENCES VESSEL_PARAM (PARAM_NAME,LIST_PARAM_VALUE.DATA_VALUE)
    /
    SHOW ERROR;
    Thank you

    Salvatore

    Could you please indicate your answer as correct if you judge them correct.

    Best regards

    Mohamed Houri

  • foreign key with the apps table

    Hello world

    I created a custom table and I want to create a foreign key with per_all_people_f.

    Code:
    ALTER TABLE xxsshr.xxsm_sshr_hr_approver
    ADD CONSTRAINT fk_person_id
    FOREIGN KEY (person_id)
    REFERENCES HR. PER_ALL_PEOPLE_F (person_id)

    However, I get ora-00942: table or view does not exist.

    We use 11.5.10 and g 10 dB

    Thanks for any help...

    Elmer

    The XXSSHR account will need reference and select the privileges (and maybe others) on the PER_ALL_PEOPLE_F table. The ALTER TABLE statement must be run under the account XXSSHR after the above privileges are granted.

    HTH
    Srini

  • actually logical foreign keys

    Hello

    Can I define foreign keys in the logical fact table? I need to use '= count distinct aggregation rule' column of the foreign key in my reports.

    Thank you.

    Andy

    Hi Andy,.

    You can add foreign keys to your fact table as a measure column (aggregate distinct count).

    Do not use these foreign keys to create foreign key joins in the logic layer. Always use complex joins (http://obibb.wordpress.com/2010/08/06/joins-in-oracle-bi-ee/)

    Good luck

    Daan Bakboord
    http://obibb.WordPress.com

  • A table with two foreign keys

    Hi all

    I need to create a table (mytable) filled from 2 different tables, for example, table1 and table2

    When the rows of the table (mytable) comes from the first table (table1) columns in mytable (foreign key to the second table) are nulled, when they come (foreign key) column in the second table (table2)
    the first table) are cancelled as well.

    In terms of performance, architecture is valid, in other words, create a foreign key 2 on mytable and consequently, (the composite foreign key in this table are null according to whether they belong to the first or the second table)?

    Thanks in advance for any help

    I hope to clear

    As promised,

    mhouri.world > create table p as select * from all_users;
    
    Table created.
    
    mhouri.world > alter table p add constraint p_pk primary key (user_id);
    
    Table altered.
    
    mhouri.world > create table c (user_id references p, name varchar2(30));
    
    Table created.
    
    mhouri.world > select min(user_id),max(user_id) from p;
    
    MIN(USER_ID) MAX(USER_ID)
    ------------ ------------
               0           72                                                       
    
    mhouri.world > insert into c (user_id, name) values (0, 'test without index');
    
    1 row created.
    

    Thanks to the autonomous operation I simulates the effect of two users working on the same parent/child table

    (a) first of all, without any index covering the FK on the child table

    (b) second with a function based index on the FK column (note the desc clause in the definition of the index)

    (c) and finally with an index b-tree on the FK columns

    case (a)

    mhouri.world > declare
      2  pragma autonomous_transaction;
      3  begin
      4  delete from p where user_id = 72;
      5  commit;
      6  end;
      7  /
    declare
    *
    ERROR at line 1:
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at line 4 
    
    mhouri.world > rollback;
    
    Rollback complete.
    

    case (b)

    mhouri.world > create index fbi_c_fk on c (user_id desc);
    
    Index created.
    
    mhouri.world > insert into c (user_id, name) values (0, 'test with fbi index');
    
    1 row created.
    
    mhouri.world > declare
      2  pragma autonomous_transaction;
      3  begin
      4  delete from p where user_id = 72;
      5  commit;
      6  end;
      7  /
    declare
    *
    ERROR at line 1:
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at line 4 
    
    mhouri.world > rollback;
    
    Rollback complete.
    

    case (c)

    mhouri.world > create index btree_c_fk on c (user_id);
    
    Index created.
    
    mhouri.world > insert into c (user_id, name) values (0, 'test with b-tree index');
    
    1 row created.
    
    mhouri.world > declare
      2  pragma autonomous_transaction;
      3  begin
      4  delete from p where user_id = 72;
      5  commit;
      6  end;
      7  /
    
    PL/SQL procedure successfully completed.
    

    Only the index b-tree covered with success the threat of the deadlock in key foreign unidexed

    Best regards

    Mohamed Houri

  • Lost after activation of the version foreign key relationship tables

    I created 2 tables to test this: approach the table and the Customer table that has a column AddressId referencing the Id primary key column in the Address table.

    So I ran the following statement in pl/sql developer:

    Start
    dbms_wm. EnableVersioning (' address, customer ', 'VIEW_WO_OVERWRITE');
    end;

    Then I couldn't find the foreign key in the table customer_lt or. What's not here?

    Thanks for any clue.

    -Nico-

    Hello!

    which is expected. OWM manages foreign in their own country keys when you encounter tables enabled version, that's why you don't see them anymore.
    Please see Chapter 1.9 ('constraint with Workspace Manager support') in the documentation for more information.
    When you open a DDL session on a version-enabled table, you can see the foreign keys on the temporary table _LTS. It is also the only way later on Add/Remove foreign key constraints.
    Apart from this, you can use the views ALL_WM_RIC_INFO or USER_WM_RIC_INFO to display foreign key metadata.

    hope that helps.

    Kind regards

    Andreas

  • Create table - foreign key

    Hi all.

    I started to create tables in SQL.

    My question is about the best way to refer to a column as a foreign key.

    Example:

    A simple way to make a primary key field.

    CREATE table emp (emp_id number (3.0) not null not the primary key)

    This will create emp_id as the primary key of the table emp.


    If there is another field, dept_no and this must be the foreign key.

    CREATE table emp (emp_id number (3.0) not null primary key, dept_no?)


    So my question is what is the most easy, less complicated way to make the dept_no field a foreign key to the emp table

    Thank you
    GtG

    Try like this...

    CREATE table emp (emp_id number (3.0) not null primary key, done dept_no refers to table_name (coluimn_name));

    -Clément

  • Foreign key, check force

    Hello

    This is the structure of two two table.

    Untitled.png

    DDL:

    CREATE TABLE TEST_PARENT
      (
        PARENT_KEY NUMBER (22),
        PARENT_ID NUMBER (22),
        PARENT_NAME VARCHAR2 (255 CHAR),
        EFFECTIVE_START_DATE DATE DEFAULT sysdate NOT NULL ,
        EFFECTIVE_END_DATE   DATE
      ) ;
    ALTER TABLE TEST_PARENT ADD CONSTRAINT PK_TEST_PARENT PRIMARY KEY ( PARENT_KEY ) ;
    
    
    CREATE TABLE TEST_CHANNEL
      (
    
    
        CHANNEL_KEY NUMBER (22),
        CHANNEL_ID NUMBER (22),
        CHANNEL_NAME VARCHAR2 (255 CHAR),
        EFFECTIVE_START_DATE DATE DEFAULT sysdate NOT NULL ,
        EFFECTIVE_END_DATE   DATE 
      ) ;
    ALTER TABLE TEST_CHANNEL ADD CONSTRAINT PK_TEST_CHANNEL PRIMARY KEY ( CHANNEL_KEY ) ;
    

    Logic:

    Parent_id is always fixed to a Parent. But a Parent can have different attributes (parent_name here). Where the attributes are changing it will end the bu previous records put a value to effective_end_date and it will create a new line. New line will have the PARENT_KEY new PARENT_NAME with new effective_start_date and null in effective_end_date.

    Same logic applies to the CHILD table as well.

    What is the best way to put a reference to the type of the foreign key in the CHILD table that in case, will ensure that a child cannot exist without a parent now. I can't take PARENT_KEY as a foreign key to the same parent can change the PARENT_KEY and a child must always point to the parent ASSET (EFFECTIVE_END_DATE as null) folder.

    Thanks in advance.

    I would enrich your datamodel by tables of the object/version as:

    CREATE TABLE TEST_PARENT_OT
    (
    NUMBER OF PARENT_KEY (22) NOT NULL
    ) ;

    ALTER TABLE TEST_PARENT_OT ADD CONSTRAINT PK_TEST_PARENT_OT PRIMARY KEY (PARENT_KEY);

    CREATE TABLE TEST_PARENT_VT
    (
    NUMBER OF PARENT_KEY (22) NOT NULL,
    NUMBER of VERSION_ID (22) not null,
    PARENT_NAME VARCHAR2 (255 CHAR),
    EFFECTIVE_START_DATE DATE default sysdate NOT NULL,
    DATE OF EFFECTIVE_END_DATE
    ) ;

    ALTER TABLE TEST_PARENT_VT ADD CONSTRAINT PK_TEST_PARENT_VT PRIMARY KEY (PARENT_KEY, VERSION_ID);
    ALTER TABLE TEST_PARENT_VT add CONSTRAINT FK_PARENT_VT_PARENT_OT foreign key (parent_key) refers to test_parent_ot (parent_key);

    CREATE TABLE TEST_CHANNEL_OT
    (
    NUMBER OF CHANNEL_KEY (22) NOT NULL
    ) ;

    ALTER TABLE TEST_CHANNEL_OT ADD CONSTRAINT PK_TEST_CHANNEL_OT PRIMARY KEY (CHANNEL_KEY);

    CREATE TABLE TEST_CHANNEL_VT
    (
    NUMBER OF CHANNEL_KEY (22) NOT NULL,
    NUMBER OF VERSION_ID (22) NOT NULL,
    PARENT_KEY NUMBER (22) NOT NULL,
    CHANNEL_NAME VARCHAR2 (255 CHAR),
    EFFECTIVE_START_DATE DATE default sysdate NOT NULL,
    DATE OF EFFECTIVE_END_DATE
    ) ;

    ALTER TABLE TEST_CHANNEL_VT ADD CONSTRAINT PK_TEST_CHANNEL_VT PRIMARY KEY (CHANNEL_KEY, VERSION_ID);
    ALTER TABLE TEST_CHANNEL_VT add CONSTRAINT FK_CHANNEL_VT_CHANNEL_OT FOREIGN KEY (channel_key) REFERENCES TEST_CHANNEL_OT (channel_key);
    ALTER TABLE TEST_CHANNEL_VT add CONSTRAINT FK_CHANNEL_VT_PARENT_OT FOREIGN KEY (PARENT_key) REFERENCES test_parent_ot (parrent_key);

    Using this you will not have to reallocate your child of the lines when a new version of parent is created and you will be able to have the independent channel versions of the parent versions (so no need to change all the children when the parents ends).

    the construction of views of parents and the channels which only show active lines.

    The problem you may have is to be sure to have for each point in time an active version and so I would not implement of an effective_end date, but inherit the effective end of the effective next to (which is a little more work but you will help gapelessness if necessary)

    HTH

  • How to make a primary foreign key?

    I'm working on my data model and I can't understand how a foreign key to be a primary foreign key... I'll make a primary foreign key for this specific table 2...
    I tried to do the foreign key checked as the primary_UID... but this isn't the solution... I want to show in the relational model indicated as "PF" or the primary foreign key

    Anyone know? Thanks in advance

    Hi Delos,

    What version of SQL Developer Data Modeler do you use?
    For me, it works in 3.1.1.703 and 3.1.2.704.
    Can you provide more details.
    For the logic model you can use the Unique identifier dialog box and add links to the list of used objects.

    Philippe

  • Is a foreign key MUST have a UNIQUE or PK column as a reference?

    First I tried, from what I saw Yes it must be Unique or PK. Secondly, I am pretty sure that I read somewhere where there are PK or unique. Thirdly, I checked oradocs and other pages, the thing ends, I owe an answer

    Constraint foreign key (also called a constraint referential integrity) designates a column as a foreign key and establishes a relationship between this foreign key and a primary or unique key specified, called the referenced key.


    This implies, but does not explicitly specify that it MUST be a PK or a SINGLE.


    Basically I want a simple yes/no answer just to give me some peace of mind. I don't want to waste any time, but changes to the oracle from time to time, and I'd rather have a confirmation from someone with more knowledge/experience.


    Thank you!

    Yes.

    This same document you are referencing tells you what are the rules for the creation of a foreign key.

    Data integrity

    Foreign key constraints

    Whenever two tables have one or more common columns, Oracle database can apply the relationship between the two tables with a foreign key, also called a referential integrity constraint constraint. The constraint requires that for each value in the column on which the constraint is defined, the value in the other specified that another table and column must match. An example of a referential integrity rule is that an employee may work for only one Department.

    Table 5-2 lists the terms associated with referential integrity constraints.

    Table 5-2 referential integrity constraint conditions

    Term Definition

    Foreign key

    The column or set of columns included in the constraint definition that refers to a key that is referenced. For example, the department_id column employees is a foreign key that refers to the department_id column of departments .

    Foreign keys can be described as several columns. However, a composite foreign key must refer to a primary or unique key with the same number of columns and the same types of data.

    The value of the foreign keys can be either the primary or unique key value referenced or be null. If any column of a composite foreign key is null, then the portions not null the key do not match any corresponding part of a parent key.

    Referenced key

    The unique key or the primary key of the table referenced by a foreign key. For example, the department_id column departments is the key referenced to the department_id column of employees .

    Table dependent or child

    The table containing the foreign key. This table is based on the values present in the primary or unique key referenced. For example, the employees table is a child of departments .

    Referenced or the parents table

    The table that is referenced by the foreign key of the child table. It is the key to this table reference that determines whether specific inserts or updates are allowed in the child table. For example, the departments table is a parent of employees .

    The first three terms defined in the table EXPLICITLY State references to the 'core' or 'unique' keys to the parent.

    The doc also refers to the Application Developer Guide:

    Maintaining the integrity of the data in Database Applications

    Foreign key references a primary key by default

    If the list of columns is not included in the REFERENCES option when you set a FOREIGN KEY constraint (simple or composite column), then Oracle database assumes that you want to reference the primary key of the specified table. You can also explicitly specify the columns to reference the table parent in parentheses. Oracle database checks automatically to check this list of column refers to a primary or unique to the parent table key. If it isn't, an informative error is returned.

    That the entire paragraph is as explicitly as it gets.

    No list of columns? Oracle then checks for a primary key.

    There is a list of columns? Then Oracle 'control to verify this list of column made reference to a primary or unique key'...

  • foreign key index

    I read a book on the index, he said
    You should almost always index foreign keys because they are frequently used in joins. In addition, if you intend to delete or update unique or primary keys on the parent table, you should index the foreign keys to improve the locking of child records.
    what I don't understand, I should create index on the foreign key in parent-child table or table column or both?

    Thank you

    Hello

    806540 wrote:
    I read a book on the index, he said

    You should almost always index foreign keys because they are frequently used in joins. In addition, if you intend to delete or update unique or primary keys on the parent table, you should index the foreign keys to improve the locking of child records.
    

    what I don't understand, I should create index on the foreign key in parent-child table or table column or both?

    They mean that you need to create an index in the child table, that is the table that contains the foreign key constraint.

    In order to have a foreign key constraint, it must have a primary key constraint, or a unique constraint on the column, or columns referenced in the parent table. Either type (primary key or unique) automatically creates an index, so there is nothing more you need to do in the parent table.

Maybe you are looking for