Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL

What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
Message was edited by:
Nilesh Hole

Answer for the master!!!
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
Thanks,
Karthick

Similar Messages

  • Diff b/w primary key and unique key?

    what is the diff b/w primary key and unique key?

    Hi,
    With respect to functionality both are same.
    But in ABAP we only have Primary key for the Database tables declared in the Data Dictionary.
    Unique is generally is the term used with declaring key's for internal tables.
    Both primary and Unique keys can identify one record of a table.
    Regards,
    Sesh

  • Difference between primary eindex and secondary index?

    hi experts
    pls answer me
    difference between primary eindex and secondary index?
    rewads apply.
    thanks.
    naresh.

    hi,
    check this link.
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm
    A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.
    Always it is not mandatory that an index should have all the key fields of a table. To see the index of a table
    goto SE11->specify table name->click on the indexes... button on the application toolbar.
    Based on your requirement you can you any of those index fields in the where clause of your query. Always its a better practice to use the index fields in the order specified. While selecting the records from a table it is always better to select the fields in the same order as specified in the table.

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • Difference between Primary Key and Unique Key with NOT NULL constraint

    As both can be referred to another table.
    Apart from the difference that Primary Key can be only 1 and Unique keys can be multiple,
    is there any difference?
    Like in terms of type of Index?

    PARAG_C wrote:
    As both can be referred to another table.
    Apart from the difference that Primary Key can be only 1 and Unique keys can be multiple,
    is there any difference?
    Like in terms of type of Index?Technically there is almost no difference. Logically the two are often used for slightly different concepts.
    The PK (and with it the index) is often an ID column filled by a seqeunce. This key can then be refenced by foreign key constraints on other tables. it is very useful to have this as a meaningless technical construct. Because then the chance that such a ID needs to be changed is extremly slim.
    The UK (and with it the index) is often one or several columns that represent the logical key for the entity. Foreign key constriants should not point to this. THe chance that this attribute will be changed at some point in time is way higher then for a meaningless number (ID).

  • Difference between Dimension Id and Dimension Key

    I am reading the third chapter of Rittman's OBIEE book on design of Repository.
    It says while building the BMM, don't drag the dimension Id columns from physical layer to logical layer as the BI Server takes care of the join for you but make sure you drag across the dimension key columns as you will need these later on to create your logical table keys.
    Can someone enlighten me on what is the difference between a dimension id and dimension key (may be with an example).
    Thanks.

    Besides the theory says that a fact table can reference any level of a dimension, I couldn't do it with OWB. I don't know if there is a specific way to do that, but I only could assign a dimension detail level to a fact table.
    The ID's can have different values when I use a hierarchy in a dimension. OWB generates automatically negative ID's for the more summarized levels.
    For example, a product dimension with 2 levels: category and detail. If the product has 4 categories and 20 products (detail level), the table has 4 rows for categories with negative id's. Each row has a category and the fields specific for detail level are empty. The table will have other 20 rows for the detail level, with all fields filled, and all id's positive. The table will have 24 rows in the end.

  • Difference between Domain member and standalone server with AD binding

    Hi all,
    Can anyone explain the difference between:
    A) Setting up a MacOSX server as Windows domain member server using Server Manager;
    B) Setting up a MacsOSX server as Windows standalone server and joining the Active Directory using Directory Access;
    My setup:
    ====================
    We have a Windows 2003 A.D. running, all users are set up in the A.D.
    Also we have two MacOSX servers, which provide file services (both AFP and SMB/CIFS) for Mac and Windows clients, while using the A.D. for user authentication.
    One of the MacOSX servers is configured as a domain member server, the other is configured as Windows standalone server. The latter is bound to the A.D. using Directory Access.
    Following the Apple manuals one should think that the first setup (domain member) is the best.
    As for Open Directory: both servers are running as Standalone.
    How my setup behaves
    ====================
    Official Apple guidelines are to set up the Mac server as domain member. Reality is another thing though.
    For AFP both servers perform equal: users are authenticated against the A.D. and get access to their shares. File/Folder permissions are as expected.
    For Windows clients things aren't the same.
    The server setup as Windows Domain member acts strange. Windows clients don't have single signon experience.
    Every file/folder's owner shared on this server is <<unknown>> to the client. Also, when a Windows user creates a file/folder the owner is <<unknown>>.
    Sometimes the Samba server just stops authentication. A relaunch of the Samba service fixes this.
    The server setup as a standalone server performs as expected. Windows clients have single signon experience, there are no issues with file/folder owner. Also authentication never stops.
    Several kinds of Mac   Mac OS X (10.4.9)  

    Hi all,
    Can anyone explain the difference between:
    A) Setting up a MacOSX server as Windows domain member server using Server Manager;
    B) Setting up a MacsOSX server as Windows standalone server and joining the Active Directory using Directory Access;
    My setup:
    ====================
    We have a Windows 2003 A.D. running, all users are set up in the A.D.
    Also we have two MacOSX servers, which provide file services (both AFP and SMB/CIFS) for Mac and Windows clients, while using the A.D. for user authentication.
    One of the MacOSX servers is configured as a domain member server, the other is configured as Windows standalone server. The latter is bound to the A.D. using Directory Access.
    Following the Apple manuals one should think that the first setup (domain member) is the best.
    As for Open Directory: both servers are running as Standalone.
    How my setup behaves
    ====================
    Official Apple guidelines are to set up the Mac server as domain member. Reality is another thing though.
    For AFP both servers perform equal: users are authenticated against the A.D. and get access to their shares. File/Folder permissions are as expected.
    For Windows clients things aren't the same.
    The server setup as Windows Domain member acts strange. Windows clients don't have single signon experience.
    Every file/folder's owner shared on this server is <<unknown>> to the client. Also, when a Windows user creates a file/folder the owner is <<unknown>>.
    Sometimes the Samba server just stops authentication. A relaunch of the Samba service fixes this.
    The server setup as a standalone server performs as expected. Windows clients have single signon experience, there are no issues with file/folder owner. Also authentication never stops.
    Several kinds of Mac   Mac OS X (10.4.9)  

  • Why don't I see any difference between sdt tv and HDtv even with an hd box(QIP620​0-2)

    We upgraded from the std fois box to the hd fios box QIP6200-2) I flip between the regular tv broadcast and the same broacast on the hd channel and there is just a very suttle difference in the channels. is HD overrated or is something not connected correctly.
    I have the cable in and have the HDMI cable from the box to the TV . 

    You do have an HD TV don't you? If not you will never get a true HD picture, although with that STB you can watch HD channels (but not in true HD).
    Have you gone into the Menu on the HD STB and set the Video Settings? It may be that the new STB is set to always output 480i or 480p instead of an HD signal.
    Menu ==> Settings ==> Video Settings ==> Video Format ==> needs to be 720p or 1080i to get HD picture
    I suggest you try both settings and see which looks better on your TV.
    You might also want to look at the SD Override options, which take effect when watching SD channels. I prefer Off because switching from HD to SD or SD to HD takes 3-5 seconds if set any other way. But you may prefer some other setting.
    Justin
    Verizon FiOS TV, Internet, and phone
    QIP6416-P1, IMG 1.7C, Build 09.83
    Keller, TX 76248

  • Difference between using bootcamp and building partitions with disk utility

    hy everybody,
    i successfully bought a mac (that was easy , installed windows 7 with bootcamp (quite easy) and now i 'd like to add linux also (considering ubuntu).
    before i try to do it with bootcamp i'd like to know what the impact could be...
    so i wonder; what does boot camp do and why shouldn't i do it manually with disk utility?
    all inputs are welcome
    cheers

    Why not start by filling out hardware in your profile .sig as it makes a difference.

  • Transfering difference between USB 1 and USB 2 with Zen To

    Does anyone use a USB port to transfer music with their touch. How fast is it's(or slow)
    Is it really worth paying out for one of those notebook upgrade cards for USB 2.0? what do you think?
    Also is anyone else having trouble accessing the belkin site (I wanted to look for the usb info there) but I cannot access any of their sites US Euro any of them. Weird!!!

    Thanks for all the responses, they've helped me get some kind of idea of the difference. I think I want USB 2.0 now the amount of music I'll be shifting around will make it easier.
    If you already have a USB port is it possible to get a thingy which attatches on to it too upgrade to USB 2.0 or can you load software that will do it. I have a notebook computer
    The only thing I've seen is this card thingy on Amazon but they have the info for the wrong product with it. (For like the last two months, or am I being completely thick) So I can't check out if it comes with an AC adapter (someone told me it was important to have an external power source??)
    http://www.amazon.co.uk/exec/obidos/...568674-5820438

  • Differences between primary types and wrapes

    Hi,
    I am developing an two applications that change information over RMI, i can use primitive types, like long, boolean, int or wrapes of primary types like Long, Boolean, Integer
    Beacuse both types are serializable, but i dont nkow what type must i use, somebody can explain me what is the best from the point of view of the performance and serialization????
    thanks

    The primitives, usually, unless you have a reason to use a wrapper.I would have said "...unless you absolutely have to." Autoboxing encourages the illusion that primitives and wrapper objects are interchangeable, and that's a dangerous illusion. Consider this example: import java.util.*;
    public class Test
      public static void main(String... args) throws Exception
        List<Integer> intList = Arrays.asList(1, 2, 300, 400);
        int a = 1;
        Integer b = 2;
        int c = 300;
        Integer d = 400;
        System.out.printf("%3d == %3d: %b%n", a, intList.get(0),
                          a == intList.get(0));
        System.out.printf("%3d == %3d: %b%n", b, intList.get(1),
                          b == intList.get(1));
        System.out.printf("%3d == %3d: %b%n", c, intList.get(2),
                          c == intList.get(2));
        System.out.printf("%3d == %3d: %b%n", d, intList.get(3),
                          d == intList.get(3));
    } Output:   1 ==   1: true
      2 ==   2: true
    300 == 300: true
    400 == 400: false In some cases, == is comparing two ints; in others, two objects. If you use primitives and wrappers interchangeably without appreciating the distinction, you'll never know which kind of comparison is being performed. To minimize the risk of this kind of bug, you should always declare primitive values as primitives, not as wrapper types.

  • What's the differences between a singleton and a class with static methods

    Hi everybody.
    My question is in the subject. Perhaps "differences" is not the good word. The positive and negative points ?
    Imagine you have to write a connection pool, sure you gonna choose a singleton but why ?
    Thank you very much.

    A class is a class. Java doesn't have (and I wish it
    did) a static outer class. Any class can extend
    another class or implement an interface.A Class object cannot extend or implement anything - it is not under programmer control in any way. You can create a class which implements interfaces, but calling static methods is completely unrelated. Interfaces only affect instance methods, not class ones. I think all of your comparison to C++ is actually confusing you more. In Java, there is a real class object at runtime, as opposed to C++.
    YATArchivist makes a good point about being able to
    serialize, altho I've not met that desire in practice.
    Maybe a concrete example would help.
    mattbunch makes another point that I don't understand.
    A class can implement an interface whether it sticks
    its data in statics or in a dobject, so I guess I
    still don't get that one.See my comment above. Static methods are free from all contractual obligations.
    I prefer instance singletons to singleton classes because they are more flexible to change. For instance I created a thread pool singleton which worked by passing the instance around, but later I needed two thread pools so I made a slight modification to the class and poof! no more singleton and 99% of my code compiled cleanly against it.
    When possible, I prefer to hand the instance off from object to object rather than have everything call Singleton.instance() since it makes changes like I mentioned earlier more feasible.

  • Whats the difference between Data Synchronization and Data Replication with a truncated Target?

    Hi Brian: Sorry, the Data Replication task wizard does not support ODBC sources. I don't think there's an easy way to truncate the target tables using a Data Synchronization task, but you should be able to read data from an ODBC source and write it to your target. Cheers,Josh

    I would like to replicate data using an ODBC connection as the source, but the connection does not show up in Data Replication (only Data Sync).  I want to truncate and load everything from the source--can I just use Data Sync for this process? Thanks!!

  • Difference b/w index and unique

    Hi,
    Difference b/w index and unique?

    hi,
    The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:
    You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.
    You must always specify the UNIQUE option when you create a hashed table.
    INDEX:
    An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.
    The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database
    You can also create further indexes on a table in the ABAP Dictionary. These are called secondary indexes. This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access.
    Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
    The system automatically creates the primary index. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE.
    If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVINGclauses, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
    You create secondary indexes using the ABAP Dictionary. There you can create its columns and define it as UNIQUE. However, you should not create secondary indexes to cover all possible combinations of fields.
    Only create one if you select data by fields that are not contained in another index, and the performance is very poor. Furthermore, you should only create secondary indexes for database tables from which you mainly read, since indexes have to be updated each time the database table is changed. As a rule, secondary indexes should not contain more than four fields, and you should not have more than five indexes for a single database table.
    If a table has more than five indexes, you run the risk of the optimizer choosing the wrong one for a particular operation. For this reason, you should avoid indexes with overlapping contents.
    Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column’s selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to, at most, five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table.
    If all of the columns in the SELECT clause are contained in the index, the system does not have to search the actual table data after reading from the index. If you have a SELECT clause with very few columns, you can improve performance dramatically by including these columns in a secondary index.
    What is the difference between primary index and secondary index?
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm
    A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.
    Message was edited by:
            Roja Velagapudi

  • Wat is the exact differences between clustered table and pooled table

    hi,
       can you tell me ravi...wat is the exact differences between clustered table and pooled table
    with regards//
    anilreddyg

    Hi Anil Reddy
    Pooled Tables, Table Pools, Cluster Tables, and Table Clusters
    These types of tables are not transparent in the sense that they are not legible or manageable directly using the underlying database system tools. They are managed from within the R/3 environment from the ABAP dictionary and also at runtime when they are loaded into application memory.Pool and cluster tables are logical tables. Physically, these logical tables are arranged as records of transparent tables. The pool and cluster tables are grouped together in other tables, which are of the transparent type. The tables that group together pool tables are known as table pools, or just pools; similarly, table clusters, or just
    clusters, are the tables which group cluster tables.Not all operations that can be performed over transparent tables can be executed over pool or cluster tables.
    For instance, you can manage these tables using Open SQL calls from ABAP, but not Native SQL.These tables are meant to be buffered and loaded in memory, because they are commonly used for storing internal control information and other types of data with no external (business) relevance. SAP recommends that tables of pool or cluster type be used exclusively for control information such as
    program parameters, documentation, and so on. Transaction and application data should be stored in transparent tables.
    Table Pools
    From the point of view of the underlying DBMS as from the point of view of the ABAP dictionary, a table pool is a transparent table containing a group of pooled tables which, when created, were assigned to this table pool.
    Field Type Description
    TABNAME CHAR(10) Table name
    VARKEY CHAR(n) Maximum key length n =< 110
    DATALN INT2(5) Length of the VARDATA record returned
    VARDATA RAW(m) Maximum length of the data varies according to DBMS
    Table Clusters
    Similarly to pooled tables, cluster tables are logical tables which, when created, are assigned to a table cluster. Therefore, a table cluster, or just cluster, groups together several tables of type clusters.Several logical rows from different cluster tables are brought together in a single physical record. The records
    from the cluster tables assigned to a cluster are thus stored in a single common table in the database.A cluster contains a transparent cluster key which must be located at the start of the key of all logical cluster tables to be included in the cluster. As well, a cluster contains a long field (VARDATA), which contains the
    data of the cluster tables for this key. If the data does not fit into a field, continuation records are created.
    Field Type Description
    CLKEY1 CHAR(*) First key fields
    CLKEY2 CHAR(*) Second key field
    CLKEYN CHAR(*) nth key field
    PAGENO INT2(5) Number of the next page
    TIMESTMP CHAR(14) Time stamp
    PAGELG INT2(5) Length of the VARDATA record returned
    VARDATA RAW(*) Maximum length of the data section; varies according to database system
    Working with Tables
    The dictionary includes many functions for working with tables. There are five basic operations you can perform on tables: display, create, delete, modify, copy. Please do not confuse displaying a table with displaying the table entries (table contents). In order to display a table, it must previously exist; otherwise the system will display an error message in the status bar. For the following example, the table TABNA is used. To display this table, from the main dictionary screen, enter the table name in the Object name
    input field with the radio button selected next to Tables. Then, click on the Display button at the bottom of the screen, or press the F7 function key, or, alternatively,
    select Dictionary object Display from the menu.
    In this screen, you can see table information such as
    ¨ Table type, shown next to the name of the object. In the example, it is a transparent table.
    ¨ Short text description.
    ¨ Name of the user who made the last change, and the date of the change.
    ¨ Master language.
    ¨ Table status. On the screen, you can see this table is saved and active.
    ¨ Development class. For information on development classes, refer to Chap. 6.
    Delivery class, which sets the maintenance group for the table. It controls how tables will behave during client copy procedures, upgrades, and so forth.¨
    Tab. Maint. Allowed flag, which indicates whether you can generate a screen for maintaining table entries.
    ¨Then, on the lower part of the screen, you can see the table fields with all associated characteristics such as:
    ¨ Field name.
    ¨ Key indicator. When set, this field is the primary key, or part of it.
    ¨ Data element.
    ¨ Basic data type.
    ¨ Length.
    ¨ Check table.
    ¨ Short text, describing the field.
    Additional information about the table can be displayed by selecting the corresponding functions from the menu or directly from the application toolbar, such as keys, indexes, or technical settings
    Standard table:
    The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
    You should usually access a standard table with index operations.
    Sorted table:
    The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Index table:
    The table can be a standard table or a sorted table.
    Index access is allowed to such an index table. Index tables can be used to define the type of generic parameters of a FORM (subroutine) or a function module.
    Just have a look at these links:
    http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/74/83015785d811d295a800a0c929b3c3/frameset.htm
    Regards
    Sreeni

Maybe you are looking for

  • Problem with selecting text in a PDF document

    I'm having a problem with Acrobat 9 and Reader 9.  PDF document that has copying and selecting permissions granted, when I highlight text for copying, some of it gets highlighted and some doesn't.  Put the same document on several computers in the of

  • Update showing as not applicable?

    I manage a network of 675 POS terminals running Windows Embedded Standard 7.  Because these terminals are located across the state, I use PowerShell extensively to perform tasks remotely for me. Currently, I have an MSI file that I need to install on

  • Info problem after upgrading to texinfo 5.2-1

    Hi, After upgrading texinfo 5.1-1 to 5.2-1, I'm unable to use control-n to move cursor down in info. I can use it again after downgrading it back. Do you have the same problem?

  • Pages spelling defective Numbered List Lion

    When I create a new blank document in Pages, the spell check works normally, placing red underlines on misspelled words. However, when I create a numbered list within that document, suddenly the spell check disappears, letting me spell words incorrec

  • How to know as5300 standard performance

    HI i am having problem in access server that the users get disconnected so i want to know the standard performance of the AS5300 access servers so that i can compare my as5300 performance with the standard access server performance. is there any comm