Need help to implement a relationship between two Tables

Hello

According to the theory, relationship of individuals: each row in the table a related to a single line in table B.


Any body could please show an example of script of such tables.

Thanks for your advice. I would like that you recover too quickly to your illness, ask questions simple doc and doing nothing to fix them yourself. This is the reason why after 173 messages you can't write anything yourself.

I saw your previous posts as (responded to some of them also)
PL/SQL: ORA-00933: not correctly completed SQL command (Ask for the creation of a very simple procedure)
How can I take backup of the Table with all the data (Ask how to take backup of a table)
Writing a query to display data WHERE the data in column begin not with 'Rep' (Ask how to write a NO AS clause)

One-to-one relationship is used in super type / sub-type relationship and there are many examples in asktom also (I got those using Google).

Tags: Database

Similar Questions

  • two relationships between two tables

    Hi all

    I created a cube in my db (using OWB) of two relationships to my time dimension. A relationship shows the start time of a process, that the other represents the date of termination or end.

    example of the cube:

    Fact1
    Fact2
    Dim_Time1
    Dim_Time2

    where Dim_time1 and Dim_Time2 link to the same dimension.

    Unfortunately I have trouble this manually import in obiee administrator. I imported the fact table and the dimension of the physical layer table. Can I move to the business layer and create the two joins between two tables. But the overall consistency check up a mistake, I shouldn't have two relationships between two tables and remove a foreign key.

    What I am doing wrong?

    Kind regards

    Knut

    Knut,

    In your example, you should have a time dimension in the phyiscal layer and alias of this 2 x, for Dim_time1 and for Dim_time2, in this way aliases are separate tables as the BI server point of view and you define releations separate on the same table, you can define specific to each alias dim relevant time joins.

    In this way, you will have two time decreases intensity in MDB layer also, has 'Dim-Start Time' and a ' Sun - term time "or similar.

    Hope this helps,
    Alastair

  • Use a where clause clause if there is a relationship between two tables

    Is it possible to use a where clause clause if there is a relationship between two tables.
    I have a relationship between two tables:
    And a.customer = b.customer (+)

    If b.customer exists in a.customer I would add this in where clause
    And b.info = 'X '.
    But how?

    It's the outer joins by chance?

    If so, why not just:

    and  b.customer(+) = a.customer
    and  b.info(+) = 'X'
    

    BTW, I put the two "b" on the left column to make it easier to read. Some people mix that makes me crazy, but makes no difference to the query.

  • I need to implement Drag N Drop between two tables that saves the two records

    I need to implement Drag N Drop between two tables that saves the two records on a third page, using drag 'n drop.

    Check out this video http://baigsorcl.blogspot.com/2011/01/drag-and-drop-collection-in-oracle-adf.html

  • I got a prob while creating a link/link between two tables in a jdeveloper11g

    Hi guys...

    I got a prob while creating a link/link between two tables in a jdeveloper11g, help me.

    I use two table employee, Department.

    Unfortunately there is no primary key and foreign key in these tables.now i updated on those of table structure.

    I want to create a form like it should be a link between the Department data, i.e. data and employee while the Department is changed then only present corresponding employees in this block...

    Table structure as follows

    Employee:

    -------------------

    employe_id,

    name,

    Department,

    GR,

    Date of birth

    Department of justice

    Department:

    --------------------

    department_id,

    department_name;

    Note: in the employee department table is the same as in the department table department_id...

    So, you want to build master / detail between Department & sub_departments?

    In the same way, create a new, yet another link between departments & sub_departments, so that the connection is:

    Department.Department_Id = sub_departments.department_id

  • How to find the relationship between the tables

    Hello
    I am working in Oracle R12

    How to find the relationship between these tables INV_MIN_MAX_TEMP, po_requisition_lines_all and Per_all_people_f

    These two tables, I joined with po_requisition_lines_all and Per_all_people_f To_person_id of PO and anyone HR table but I can't able to join this table with other tables INV_MIN_MAX_TEMP

    concerning
    Srikkanth

    solved

  • SQL Developer / Data Modeler - lost visual on the relationships between the tables

    11 GR 2 DBMS / SQL Developer 4.0.3

    In SQL Developer, using the Data Modeler I lost the visuals 'lines' (one to several, etc.) which show the PK to FK relationship between different tables from one of my patterns of relationship.  I know they exist - I'm sure it's my fault--put out something that I don't have.

    I looked on the web but without SOAP.  Can anyone tell me if it is a property and (as applicable) how to re - turn on the property.

    Thanks in advance.

    Barry D.

    Sorry - I found it - the relationship lines were VERY clear yellow and I could barely see it.

    Article by Jeff Smith on the model configuration screen has been very useful in this regard.

    http://www.thatjeffsmith.com/archive/2013/01/Configuring-display-of-model-relationships-in-Oracle-SQL-Developer-Data-Modeler/

    Thank you Jeff (again).

    Barry D

  • How to remove the extra space between two Table HTML

    Hello

    I wrote a code for printing costs. But there is more space between two Table Html, how I can remove it.

    Please run that Code

    Start

    HTP.p (')
    < html >
    (< body > ');

    HTP.p (')
    < TABLE align = "left" width = "500" cellspacing = "0" cellpadding = "0" border = "1" >
    < tr > < td align = 'right' white-space: nowrap; > Ph-2201751 < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > < B > < table > < /B > SATYAM MODERN PUBLIC SCHOOL
    < td > < table >
    < /tr >
    < b >
    < td align = "center" white-space: nowrap; > < i > < H3 > (AFFILIATED to THE CBSC, NEW DELHI CODE No. 53544) < / H3 > < /I > < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > new colony Braham, - 131001 (h) < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > RECEPTION COSTS < table >
    < td > < table >
    < /tr >
    < /table >
    < TABLE width = "500" cellspacing = "0" cellpadding = "0" border = "1" >
    < b >
    < td width = "100" white-space: nowrap; > receipt no.: < table >
    < td width = "100" white-space: nowrap; > Date received: < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > name: < table >
    < td width = "100" white-space: nowrap; > father name: < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > class & s: < table >
    < td width = "100" white-space: nowrap; > A/C No. : < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > from: < table >
    < td width = "100" white-space: nowrap; > to: < table >
    < /tr >

    (< /table > ');
    HTP.p (')
    < / body >
    (< / html > ');
    end;


    Thank you

    Ed

    Hello

    HTML is valid, that your code print?

    
    

    Wouldn't be as below?

    
    

    BR, Jari

    Published by: jarola on December 18, 2009 15:22
    I test your code
    http://Apex.Oracle.com/pls/OTN/f?p=40323:25
    I can't see any extra space between the tables

  • Need help with a virtual machine between multiple users on iMac even...

    So I installed Fusion on my Intel iMac and created a virtual machine that uses Windows Vista. My problem is that I need to have two accounts Admin on Mac can use Vista/Fusion. I read a little about it and tried to put the virtual machine folder in the Documents of the other admin folder. Then I logged in as the admin account and Fusion found the records of the virtual machine and loaded vista fine. But of course now the first admin account cannot open Vista more. My question is can I copy the VM "Bundle" in the documents of the other account, so both users have files? Or with this screw things?

    Or should I put the virtual machine 'bundle' in the shared folder to make it work as I need to? I know that the two users can access the same VM at the same time, but as long as a user stop Vista and the merger and disconnects, can another user log in and open Vista/Fusion?

    Help, please! Thanks in advance.

    The Beginner Guide to VMware Fusion: sharing a VM between users

  • How to create a relationship between two blocks

    Oracle forms 6i
    Hai All

    I've created a form that I have four button ADD, QUERY, SAVE, EXIT.

    I have two block named head and members.

    Four Chief areas namely block unitid, deptcode, codeno name.

    When I pressed the query button, and the cursor goes to the Chief name field when I enter the name of the leader and click

    Enter I give the codeno, the deptcode and the unitid of the leader_name.

    so now, I created another block in a tabular structure to bring members in the same deptcode that belongs to Leader_name.

    So pls tell me the steps how to create the relationship between these two blocks.


    When I enter the leader_name and gives enter need to bring the codeno, the deptcode, the unitid and

    I also need to give the members of this deptcode...


    Thanks in advance

    Srikkanth.M

    To write, only State a selection:

     :blk2.item = :blk1.item
    

    François

  • Need help to calculate the difference between times

    Hi all

    I have two fields that stores just the hour in 24-hour ex: 08:00 and 20:00 now I want to calculate the difference between two times

    Kindle help me

    Thanks for your help

    Thank you
    Ravi

    Hello

    diiference in hours

    SQL> WITH T AS (SELECT '08:00' ST_TIME, '20:00' END_TIME FROM DUAL)
      2  SELECT (TO_DATE (END_TIME, 'HH24:MI') - TO_DATE (ST_TIME, 'HH24:MI')) * 24 DIFF_HOURS
      3    FROM T;
    
    DIFF_HOURS
    ----------
            12
    
    SQL> 
    

    G.

  • Need help with implementing DLL based on LabVIEW below call Lib

    Here is the list of C functions in the doc that I have, but I don't get the right result.

    I need help to understand how these features and how to configure it in LabVIEW

    Parameters

    voltType
    [in] Specifies a voltage detector to get the value of. There may be flags
    VCORE (1<>
    V25 (1<>
    V33 (1<>
    V50 (1<>
    V120 (1<>
    VSB (1<>
    VBAT (1<>
    VN50 (1<>
    VN120 (1<>
    ATV (1<>
    retval
    [out] Points to a variable in which this function returns the voltage in volts.
    Typesupport
    [out]
    If the value is specified as a (non-NULL) pointer to a variable, it will return the types of sensors available in indicators at the level of the ILO-ORed
    Return value
    TRUE (1) indicates a success; FALSE (0) indicates a failure.
    Remarks
    Call the function first with a typesupport non-NULL of the sensors available fan and a subsequent call to get the required voltage.

    Thanks to all...!

    I solved this problem.

    There was a problem in the configuration of the VoltType. We have a cluster of bits.

    Here is the screenshot.

  • How to establish the relationship between the tables contact and Global (entity) in Oracle Service Cloud to preconfigure data

    Hello

    We strive to integrate the OPA attributes to the Cloud Service Oracle tables to store session data for the customer portal users.

    We tried mapping the attributes of the OPA with relevant tables of cloud Service Oracle? Is there any installation of additional data to create to retrieve the session data for the particular user / contact?

    We managed to save tha data in arrays of cloud Service for users of ananymous and also well regarding customers portal users but to preconfigure data do we need to do any additional configuration / mapping to the contact table?

    Please help on the establishment of the relationship between the contact and Global (new table created in cloud Service) tables.

    Thank you

    Vivek

    Hi Vivek,

    To load data from the Contact in the the OPA policy template, you must configure the widget of the OPA. For instructions, see the following articles:

    - Incorporate an interview that uses data portals in Oracle Service Cloud Customer Portal

    - Deploy and configure the sample OPA widget

    - Insert the widget to sample in a customer portal page

    Obviously, you need to do the mapping in OPM as well, but even if the mapping is correct, you will not be able to load the Contact data unless the widget of the OPA is implemented.

    See you soon,.

    Jasmine

  • Comparison between two tables

    Hello

    I have two tables USERS and LISTS:

    And I want that there is a comparison between these two tables executed when user table USERS connect to the application.

    They must compare the columns between the SEXES and AGE and if some users have the same attributes in its ranks as in a line in the table LISTS (here is unique each line) so that the user gets in his line in the column 'LIST_ID' the ID of the line with which attributes between GENDER and AGE.

    Example:

    USERS TABLE: exampleuser | Boby | McGrahem | Male | 18. -------

    LISTS OF TABLE: 28 | examplelist | Male | 18

    Once the Login of the user Boby gets in its ranks the ID = 28 because the SEX and AGE corresponds to the row of table LIST:

    Result:

    USERS TABLE: exampleuser | Boby | McGrahem | Male | 18. 28

    
    CREATE TABLE  "USERS" 
       (    "USERNAME" VARCHAR2(15) NOT NULL ENABLE, 
            "FORRNAME" VARCHAR2(15) NOT NULL ENABLE,                  
            "SURNAME" VARCHAR2(15) NOT NULL ENABLE, 
            "GENDER" VARCHAR2(10) NOT NULL ENABLE,   
            "AGE" NUMBER, 
            "LIST_ID" NUMBER, 
             CONSTRAINT " USERS_PK" PRIMARY KEY ("USERNAME")
      USING INDEX  ENABLE
    
    

    CREATE TABLE  "LISTS" 
       (    " LIST_ID" NUMBER NOT NULL ENABLE, 
            " LISTNAME" VARCHAR2(50) NOT NULL ENABLE, 
            "GENDER" VARCHAR2(10) NOT NULL ENABLE, 
            "AGE" VARCHAR2(3) NOT NULL ENABLE,  
             CONSTRAINT " LISTS_PK" PRIMARY KEY ("LIST_ID")
      USING INDEX  ENABLE
       
    

    I need help for coding this, if someone be so good.

    This is my essay:


    DECLARE  
        v_listid varchar2(100);   
        BEGIN  
          
        SELECT  LIST_ID into v_listgid
         FROM LISTS
         WHERE GENDER = (SELECT GENDER
                              FROM USERS 
                            WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER)))
         AND AGE = (SELECT AGE
                              FROM USERS  
                            WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER)));
    
         UPDATE USERS   
        SET LIST_ID =  v_listid   WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER));  
      
        END;
    

    I'd like to REALLY shy away using the USER name as the primary key, because the fact that users can create duplicate user names... YOU should NEVER base a PK on the entry of user, the better to let the database create and maintain this element of date...

    FIX:

    UPDATE to users U

    SET List_Id = (SELECT List_Id OF lists L WHERE L.Gender = U.Gender and L.SOMENUMBER = U.SOMENUMBER) AND

    Upper (U.UserName) = UPPER(:APP_USER);

    Don't really want to cut the strings, Oracle which will do since they are of type varchar2 columns...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • getting data between two tables

    Hi everyone, I need help with a query that seems simple, but I can't understand. consider the following data.

    with data as (

    s élire 802 cd from dual union all

    select 803 cd from dual union all

    select 804 cd from dual

    data2 as

    ( select 804 cd from dual )


    I want to join the two tables so that the result will be as follows:

    in the above data, we can see that 804 is common in both tables.  in this case, the output should be 804.

    Similarly, if 2 data include the following:

    data2 as

    ( select 804 cd from dual union all

    Select 803 cd from dual

    )


    the output is then 803 804.



    Now consider the following data

    with data as (

    s élire 802 cd from dual union all

    select 803 cd from dual union all

    select 804 cd from dual

    )

    take data2 table is empty


    I want to join the two tables, and in this case, the output should be 802,803,804.  data2 table is empty, then the default behavior is to get all the data in the data table. Since there is no line that corresponds to rows in the data table,

    the default behavior is to display output all data in the data table.  in this case 802,803,804

    can someone write a query for this?

    Hello

    elmasduro wrote:

    Hi Frank, thanks for the request.  These are very good questions. Here are the answers

    What happens if data2 rows, but none of them match data CD?

    It won't happen because the integrity of the data.

    ...

    I see it; a data line 2 will be in the data.  You have a FOREIGN KEY constraint, or something similar, so if cd = 804 exists in database2, then it must also exist in the data.

    What happens if the data is empty and data2 is not?

    If data is empty and data2 is not, then the data2 data should be released.

    for example

    with the data as)

    data table is empty

    data2 as

    (select cd 804 Union double all the)

    Select cd 805 double

    )

    When you join data and data2 account with the above data, then the output should be 804 805.  data2 data should be the display if the data table is empty. ...

    Doesn't that contradict what you said earlier?  Previously, it seemed to say that each row of data2 will be in the data, but now you give an example where all data2 lines are not in the data.

    If the first is true, then the solution in response #2 should work.

    If the latter is true, you can change the query like this:

    WITH got_r_num AS

    (

    SELECT NVL (d.cd, d2.cd) AS cd

    DENSE_RANK () (ORDER IN CASE

    WHEN d.cd IS NOT NULL

    AND d2.cd IS NOT NULL

    THEN "A".

    WHEN d.cd IS NOT NULL

    THEN 'B '.

    ANOTHER 'C '.

    END

    ) AS r_num

    DATA d

    FULL OUTER JOIN data2 d2 ON d.cd = d2.cd

    )

    SELECT cd

    OF got_r_num

    WHERE r_num = 1

    ORDER BY cd

    ;

Maybe you are looking for

  • Windows 10 drivers for Mac

    Hello I have recently installed windows 8 via bootcamp, then updated to windows 8.1. Then I downloaded an iso 10 and updated Windows updated my 8.1 to 10. But now im having some driver problems. When I was using windows 8 and 8.1, I had no problem dr

  • Google.co.UK does not open because the certificate is not recognized, help

    This connection is Untrusted You asked Firefox to connect on www.google.co.uk, but we cannot confirm that your connection is secure. Normally, when you try to connect safely, sites will present a reliable identification to prove that you're in the ri

  • How to down load 3.6 for apple?

    I see that I can download the new 5. Firefox... but we had to down load the old 3.6 to work on my Apple... How?

  • Should I backup on disk hard E or outside?

    I would like to know what the best backup option to use - hard E drive or external support please. Thank you

  • My password does not work on Microsoft Money 2004.

    Password does not work on Microsoft Money 2004. Our accounts are here! Can we get in? All the answers (well over!) would be welcome. original title: Microsoft Money 2004