Simple join question

Hi guys, I'm confused.

I was always told that one table can have ONLY 1 primary key. is this true or false? Or a table can cause several primary keys?

Second question is, if I join two tables that are formed as a result of columns.

Table 1:
Account_number
Account_create_month
Customer_address

Table 2:
Account_number
Account_create_month
Customer_phone

Should I join on account_number AND account_create_month? If yes why? and why not? Sorry if this is a stupid question. I'm just very confused. Thank you

Hello

Z KHAN wrote:
Hi guys, I'm confused.

I was always told that one table can have ONLY 1 primary key. is this true or false? Or a table can cause several primary keys?

A table can have 1 primary key. There may be any number of columns (1, 2, 3 or more) in the primary key.
A table can contain any number of unique keys.

Second question is, if I join two tables that are formed as a result of columns.

Table 1:
Account_number
Account_create_month
Customer_address

Table 2:
Account_number
Account_create_month
Customer_phone

Should I join on account_number AND account_create_month? If yes why? and why not? Sorry if this is a stupid question. I'm just very confused. Thank you

No, you do not have to connect using the two. If you use the two in a join given or not depends on what the data means, and what results you want.

Tags: Database

Similar Questions

  • Functions of outer join left as simple join

    I created two views SCO_REQGROSSLINES_V and SCO_REQLINESCOMPLETE on Oracle applications tables base. Our company applies the following identity rules: the gross number of rows is always greater than or equal number of demand lines. (Full, I mean delivered.)

    Each view has a key named DATESUBINV_KEY built a date of the operation and the code subinventory using this logic:

    TO_CHAR (TRUNC (transaction_date), 'YYYYMMDD') | subinventory_code

    On 03-SEP-2010 a user has created a demand with a line item for the material of the HEAT subinventory who did not. This row is returned in the result set when I ask about SCO_REQGROSSLINES_V but does NOT return when I ask about SCO_REQLINESCOMPLETE. So far so good.

    When I run either of the left outer joins following, I don't get the line for the line for HEAT subinventory 03-SEP-2010:

    Select rgl.trxn_date
    rgl.subinventory
    rgl.line_count gross_line_count
    rgl.ext_prc gross_value
    rlc.line_count lines_filled
    rlc.ext_prc lines_filled_value
    of SCO_REQGROSSLINES_V vö outer join left sco_reqlinescomplete_v rlc
    ON rgl.datesubinv_key = rlc.datesubinv_key
    where vo. TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    order of rgl.trxn_date, rgl.subinventory

    Select rgl.trxn_date, rgl.subinventory
    rgl.line_count gross_line_count
    rgl.ext_prc gross_value
    rlc.line_count lines_filled
    rlc.ext_prc lines_filled_value
    of SCO_REQGROSSLINES_V vo
    sco_reqlinescomplete_v rlc
    where vo. TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    AND rgl.datesubinv_key = rlc.datesubinv_key (+)
    order of rgl.trxn_date, rgl.subinventory

    Question: Why the left outer joins is would work as a simple join on DATESUBINV_KEY? Do the keys function differently from the keys defined in the data dictionary views? If they do how these keys work as data dictionary keys?

    Hello

    The WHERE clause is applied after the outer join is complete. In your example, Vo will be in the game even if they have no match in rlc. In this case, all columns of rlc will be NULL.
    Okay, so you have these lines containing data from vo but NULL values, where the rlc data was supposed to go. Now it's time to start the WHERE clause. You then apply that conditions in the WHERE clause:

    AND     rlc.trxn_date BETWEEN ...
    

    NULL is between what whether, if the line the prodeuced the outer join is rejected.

    All the columns in involivn conditions of rlc probably needs to be part of the join condition, not the WHERE clause.
    For example, in you first ask the FROM and WHERE clauses can be:

    FROM          sco_reqgrosslines_v      rgl
    LEFT OUTER JOIN  sco_reqlinescomplete_v  rlc  ON    rgl.datesubinv_key   = rlc.datesubinv_key
                                            AND   rlc.trxn_date       BETWEEN TO_DATE ( '29-AUG-2010'
                                                                        , 'DD-MON-YYYY'
                                                            )
                                                  AND       TO_DATE ( '04-SEP-2010'
                                                              , 'DD-MON-YYYY'
                                                            )
    WHERE   rgl.trxn_date     BETWEEN TO_DATE ( '29-AUG-2010'
                             , 'DD-MON-YYYY'
                             )
                   AND     TO_DATE ( '04-SEP-2010'
                             , 'DD-MON-YYYY'
                             )
    

    Always use (at least) two arguments when calling TO_DATE.

    Conditions that involve only VO can be in the WHERE clause, but if all the rlc conditions in the WHERE clause, then the effect will be the same as a join internally.

    It is no difference between tables and views (or subqueries) in this regard: the same thing would happen, whether it is vo and rlc really tables or not.

  • Join question / unlink you domain Windows 8

    I recently performed a clean installation of Windows 8 without problem. I tried to join to a domain. Everything seems to work as expected and I even got the standard windows of information indicating that I have was greeted at the field and I had to restart. After the reboot, I am unable to log on to the domain and I get a message indicating that the trust relationship is broken. Unfortunately, I can't use my local admin account either... the system is telling me no matter what I try to do requires high privileges which I am unable to access the connection with the Act that the workstation has not correctly joined to the domain. In addition, for the domain controller, I can not find a computer account for this system. Is there an easy way to separate this pc "is not entirely-joints" the domain and return it to a State of "stand alone" so I can try to join again? Thanx.

    Hello

    For the Domain Join questions, I recommend that ask you this question on the following forums.

    Windows 8 IT Pro category:

    http://social.technet.Microsoft.com/forums/en-us/category/w8itpro

    Concerning

  • If exposed simple of questions?

    Alright fellow programmers.  Once more what I meet a problem I have EVER had with other JAVA programs before.  IAM trying to figure out how to write a simple if statement and I have questions.  I did Google search and have found something to help.  So, if you could please tell me what may be the issue?  The error message is "error {invalid AssignmentOperator. syntax".   Thanks in advance!

    Double BinRadius = (Integer.parseInt (txtRadiusFeet.getText ()) * 12) + Integer.parseInt (txtRadiusInches.getText ());

    FieldChangeListener CalcListener = new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
    Double BinRadius = (Integer.parseInt (txtRadiusFeet.getText ()) * 12) + Integer.parseInt (txtRadiusInches.getText ());

    {If(BinRadius==0)}
    Dialog.Alert ("Hello");
    }
    };

    Capital I yew?

  • A simple PHP Question

    Hey guys,.

    I learn some basic PHP to make a simple form, and I have a small question. I have these two test of the PHP, Form.php and acion.php files. What you enter in the form is then displayed via $_POST to action.php that gets displayed. Here are the test sites:

    http://christianstest.info/phptest/form.php

    http://christianstest.info/phptest/action.php

    And for two, verry simple code:

    Form.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PHP Form Test</title>
    </head>
    
    <body>
    <form action="action.php" method="post">
     <p>Your name: <input type="text" name="name" /></p>
     <p>Your age: <input type="text" name="age" /></p>
     <p><input type="submit" /></p>
    </form>
    
    </body>
    </html>
    

    and action.php


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    Hi <?php echo htmlspecialchars($_POST['name']); ?>.
    You are <?php echo (int)$_POST['age']; ?> years old.
    </body>
    </html>
    

    Now I want to do is have action.php store data entered in Form.php so that someone could link directly to action.php and see what the end user concluded Form.php. Now, if you go directly to a non action.php caching it does nothing for the return of name and age. How can I get this data stick? If in fact, it is not a simple question, can you point me to a tutorial? Thank you!

    You'll want to republish this topic in the Dreamweaver forum:

    http://forums.Adobe.com/community/Dreamweaver?view=discussions

    Take care, Mike

  • Gites join Question!

    Hi guys,.

    I need a report that displays the comm total of 'sale' and the total of the "rent" comm
    Based on the following table.


    Transaction Type Total Comm
    62 - 1000 SALE
    61 9 APRIL 11 - RENT 500
    63 - SALE 1000
    41 16 APR 11 - RENT 500

    --
    Best regards

    Hello

    You can do this with a self-join, but it is much more effective to do it like this:

    SELECT       SUM (CASE WHEN type = 'SALE' THEN comm END)     AS total_sale
    ,       SUM (CASE WHEN type = 'RENT' THEN comm END)     AS total_rent
    FROM       table_x
    WHERE     type    IN ('RENT', 'SALE')
    -- GROUP BY  ...          -- If wanted
    ;
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
    Explain how you get these results from these data.
    Always tell what version of Oracle you are using.

  • validation to a specific table only and simple a question on the dml trigger

    Hi all

    guess I am connected to a database with the user ' scott'/'tiger'@orcl and I have the fire instructions insert on 2 different tables allows say tables is
    (1) emp
    (2) Dept.

    and now I want only to commit the emp table and not the table dept, is it possible to do?

    Another question, I have... are commit simple dml triggers auto or not?

    Concerning
    Rahul

    Mac_Freak_Rahul wrote:

    and now I want only to commit the emp table and not the table dept, is it possible to do?

    No, it isn't. You post a transaction, not a table...
    So if you have handled several tables in your transaction, you agree to be all these changes (via the command commit), or any of them (via restore).

    >

    Another question, I have... are commit simple dml triggers auto or not?

    If your dml trigger manipulate data (a very bad practice by the way), then they just add to all of the changes made to the breast of your transaction, you (as mentioned above), either commit all or none.

  • simple thread question

    Hello world

    My question is quite simple.  I have two text boxes. I wrote "123" in the first text box and 'abc' in the second area. When I put the two boxes, the content in the second box automatically flowed to the first area, because there was space in the first box. Now the first box shows "123abc", and the second box is empty.

    How to stop Indesign automatically cela. Is this possible?  I know I can do it by screwing the two boxes first then the input data, but I have already entered all my data and it save me a lot of time if I can just have screw now.   Thank you very much!

    Simon

    Until you put frames, insert a frame break in all Type > submenus insert a special character

    Then content don't flow from 1 in frame 2 frame when you put on, because you insert a frame break stops at what happens.

  • Table Simple Dreamweaver question

    I have so many tables, 100 rows, 5 columns for my data.  Here's my question, is there a way to tilt the table given above then go down and up and down.  All my data is from the old to the new, when I want recent to old.  I know that you can do in Excel by alphabet or date, id there a way DW

    Someone can correct me if I'm wrong, but I'm sure you can't sort a column or row of values in a table html using DW. What you could do is create your list in Excel, sort the list in Excel and copy the range of the table and paste it into DW, which will create a perfect html table. You can also copy and paste from Dreamweaver to Excel, but it is not as simple. You will need to copy and paste a column at a time, and you will have an additional empty line for each line populated.

    Another solution is to create a mySQL table that can be easily sorted and uses PHP to display the table on your page. You must know at least the basics mySQL and PHP to do that, but if want to add constantly new records to your table, mySQL is your best solution. If your table is static, the first solution works perfectly.

  • Really simple (hopefully) question about GPIB-USB-HS

    I tried to reconnect a GPIB-USB-HS to a network through a PC HP on shelf Analyzer. Before removing the GPIB-USB-HS system about a week or two ago, Network Analyzer (a vintage 1989 HP 8720 vector Network Analyzer) had worked well with the GPIB unit. Now that I reconnected the GPIB device to network monitor, measurement and automation seems not be able to detect the Network Analyzer.

    My question is: if my GPIB-USB-HS appear in measurement and automation, and it passes the NOR-488. 2 troubleshooting of HW and SW utility test, it would be safe for me to assume that whatever connection problems I have with the Analyzer network, rather than with the GPIB-USB-HS itself?

    Thank you

    Armando83

    I finally got the connection working again. I just had to tighten the screws on the GPIB-USB-HS to make sure it's a good connection to the Network Analyzer so that it can work.

    Thanks again for your help, Dennis.

  • LEFT JOIN question

    Hello

    Here's 2 queries. First one help for the joints and the second query uses a join ancient. The first works very well and I tried to write the 2nd one to work exactly like the first. I don't know where to put the sub condition sysdate in 2nd query such that there operator.

      AND trunc(SYSDATE) BETWEEN hapf.effective_start_date(+) AND
           hapf.effective_end_date(+)
    

    1.

    SELECT papf.full_name,
           hapf.name position_name
      FROM per_people_x       papf,
           per_assignments_x  pax,
           hr_all_positions_f hapf
     WHERE papf.person_id = pax.person_id
           AND pax.position_id = hapf.position_id(+)
           AND trunc(SYSDATE) BETWEEN hapf.effective_start_date(+) AND
           hapf.effective_end_date(+)
    

    2.

    SELECT papf.full_name,
           hapf.name position_name
      FROM per_people_x      papf,
           per_assignments_x pax
      LEFT JOIN hr_all_positions_f hapf
        ON (pax.position_id = hapf.position_id)
     WHERE papf.person_id = pax.person_id
    

    Any suggestion is appreciated.

    Thank you

    KK

    SELECT papf.full_name,

    hapf. Name position_name

    THE women's wear per_people_x

    JOIN THE

    Pax per_assignments_x

    ON)

    PAPF.person_id = pax.person_id

    )

    LEFT JOIN

    hr_all_positions_f hapf

    ON)

    Pax.POSITION_ID = hapf.position_id

    AND

    trunc (sysdate) BETWEEN hapf.effective_start_date AND hapf.effective_end_date

    )

    /

    SY.

  • simple sql question

    What's not here?

    Select "update lookup_Nationalities set NAME = 'Philippinien' where NAME =' |" NAME of lookup_nationalities.

    I want to have commands like update

    Update lookup_Nationalities set NAME = 'Afghanistan', where NAME = 'Afghanistan ';

    Update lookup_Nationalities set NAME = 'Belgien' where NAME = 'Belgien ';

    Update lookup_Nationalities set NAME = 'China' where NAME = 'China ';

    ....

    thanx

    Hello

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements), so that people who want to help you can recreate the problem and test their ideas.

    Also post the exact results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    If you ask yourself on a DML statement, such as UPDATE, then the CREATE TABLE and you post instructions INSERT must re - create the tables as they are to the DML, and the results will be the content of the or a modified tables when it's all over.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

    2843667 wrote:

    What's not here?

    Select "update lookup_Nationalities set NAME = 'Philippinien' where NAME =' |" NAME of lookup_nationalities.

    I want to have commands like update

    Update lookup_Nationalities set NAME = 'Afghanistan', where NAME = 'Afghanistan ';

    Update lookup_Nationalities set NAME = 'Belgien' where NAME = 'Belgien ';

    Update lookup_Nationalities set NAME = 'China' where NAME = 'China ';

    ....

    thanx

    If you want to include single quotes inside a string literal, use either 2 single quotes inside literal, like this:

    Select "update lookup_Nationalities set NAME =" Philippinien "where NAME =' |" NAME

    of lookup_nationalities;

    or use Q-rating:

    Select Q '{update lookup_Nationalities set NAME = 'Philippinien' where NAME =}' | NAME

    of lookup_nationalities;

    Whatever it is, you don't want anything like ' | ' at the end, after the «;»

    Be careful: I bet that you do not want the output to be something like

    set lookup_Nationalities set NAME = 'Philippinien' where NAME = Sverige

    I suspect you want single-quota around Sverige, too.

  • A few simple newbie questions

    I've been running Windows Home Server on an old Dell Zion (Yes - quite pokey), I see that Dell has many things on an I3 PowerEdge T110 II. I did a lot of search in the online documentation and manuals, but have a few unanswered questions:

    o the server has a built-in SATA controller? The manual says 6 SATA connectors, but when I tried to configure the server for the purchase, it was persistent to choose me a PERC controller card. If there is a controller of the motherboard, will it be enough?

    o once again, trying to set up with UEFI boot, he said conflicts in configuration. I am the command without hard drives, but to use an existing drive to 4 TB. I'm going to need to configure GBT and will require UEFI, I think. Is this a problem?

    o any person aware of all the problems with Windows Home Server 2011 running on this platform?

    They are sold individually as no disc/OSless as the default configuration. That's fine, but I wanted to buy a couple of company drives to go with it. When I tried to configure the system with hard drives, came when all configuration conflicts. I'll try to call tomorrow, but I think the community is generally better informed than the sales people. It looks like I'll buy the unit without disc and add my own records. Recommendations for hard disks that are reasonably reliable (and cheaper than Dell)? I want to run RAID 1.

    My 'adventure' is about to begin. Thanks for the help!

    Al

    achuneke
    The server has a built-in SATA controller? The manual says 6 SATA connectors, but when I tried to configure the server for the purchase, it was persistent to choose me a PERC controller card. If there is a controller of the motherboard, will it be enough?

    Yes, he does. Don't forget to check the Onboard SATA under hard disk Configuration option. If you enable RAID, you will get the S100 controller... let off RAID and use RAID software Windows instead.

    achuneke
    Yet once, trying to configure with UEFI boot, he said conflicts in configuration. I am the command without hard drives, but to use an existing drive to 4 TB. I'm going to need to configure GBT and will require UEFI, I think. Is this a problem?

    You can't order a server without a disk (see below *). If you plan to use your own, order it with the most small/less expensive available drive, then swap later. You have NO need to specify a UEFI/BIOS at the time wherever you order the server if you intend to swap the hard drive or install the OS yourself.

    achuneke
    Anyone aware of any issues with Windows Home Server 2011 running on this platform?

    I don't see any, other than the fact that he didn't is not officially "supported", so you may run into issues at some point, but I suspect that there won't be any.

    * You said they sell it "diskless", which I have never seen. If you can, great, but if not, see my comment above. Business records are only needed if you use enterprise-class RAID controllers. Do not use the S100... is not (is not) a "business" class RAID solution

    'Real' RAID controllers (like the PERC 6 / i or H700) are not supported in the T110 II, so you don't ' really need to business records. Some have reported PERC 6/7 works to T110 II, but it is not supported, and if you choose to go this route, then make sure you have some good records designed for these controllers.

  • Simple Javascript question

    Please forgive me, I am very new to JavaScript and Acrobat.

    Can someone tell me the phrase I would use to several a number entered by a user; which would be multiplied by a fixed number? Please see image:

    The user number of backpacks, they enter the first area, the second box would have several sales of 50.

    Please let me know if you have any question. I spent some time trying to get this to work, everything I try the product and error.

    Your help is very appreciated!

    Hi rachelNS,

    You can send me a sample form and I would try it for you.

    Then you check the script on your side. Also, I would like to know what is the version of Acrobat you are using?

    Kind regards

    Ajlan Huda.

  • Potentially simple Snapshot question

    Hello. I think it would be a simple thing to look upward, but for some reason that I can't find the answer to the it.

    I am running Vi3 with ESX 3.5i hosts 4. I need to know exactly where a VM snapshot records in. I have a 250 GB drive on an FTP server that I have I envy snapshot in the future. I just formatted a table iSCSI with 440GB LUN. So if a snapshot of my 250 GB drive MUST reside on the same LUN as the original machine, obviously I would not have enough space. Can I choose where to store my snapshots?

    Thanks for the help,

    Tim

    With the VM snapshot, they are stored in the same directory as the virtual machine.  That said, when you create a snapshot it saves only the changes and therefore the space requirements depend on how long the snapshot has been kept active. Committing, it's quite abit more complicated, but as long as you do not have an active snapshot or multiple snapshots on the virtual machine, you need also not 250 GB in order to commit (which would be just inefficient).  Unfortunately I do not know a calculation that will allow you to say that, because it is based on the number of changes and levels of snapshots on the virtual machine.

    I think that it is possible to change the directory stored in the snapshot, from the command-line editing the VMX file, however I do not recommend to change.  I don't remember the exact setting off my head to do it.

    See you soon,.

    / Jonathan

Maybe you are looking for

  • I need to rearrange the order of the 'required securities' at the top of the drop-down list bookmark.

    Hi, useful friends Firefox,. I need help to reorganize my combo of bookmarks to make things run in the way that I like. I am former fighter user of Firefox (and Mozilla/Composer etc. way back when). I use Firefox 42.0 on openSUSE 13.2. These two are

  • Win7 64 bit Install.

    Hello (1) I have already installed 32-bit WinVista. I have the choice to install Win7 32-bit version or upgrade version of Win7 64 bit.  I know that I can install the upgrade from ver. Win7 32-bit and after the installation I can use the recovery pro

  • BlackBerry Z10 Z10 BBID basically frozen, will not let me check

    All I want is a ringtone, lol! I could not remember the password, so I did the steps to reset, and it won't let me. Any help is totally appreciated! Thank you!!

  • Different between primary and logical partition?

    Referring to the next video, after a free space for the new partition, I create partition, which show the logical drive (blue color), but the other partitions are of primary partitions (blue color), I would like to know it possible to create a main d

  • DELETE THE PARTITION

    I've got 2 hardrives installed on my HP Pavilion DV8T. I'm trying to reformat the second drive, which is an old hard drive from an old HP. As such, it has two partitions. I managed to format the partitions, but I am trying to delete the partition sma