Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: no primary key needed?

    hi
    i need to know if it's ok for a table without having a primary key. My friend suggested it. and I want to know if that's fine. I thought all tables need a primary key.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Table doesn't have to have a primary key. But it is recommended. I wouldn't like to have (production) tables without primary keys in my DB.

    I use such tables (without PK's) only for testing purposes and never load more than a few rows into them. (And I usually drop them immediately after tests are over).

    Primary keys provide uniqueness in your tables and, moreover, tables are indexed (which improves SELECT).

    Shortly said.

  3. #3
    Join Date
    Oct 2003
    Posts
    87
    To select a single row you need, at least, a unique index. In relational theory a PK is required and is normally built on a unique column, or set of columns most often used to access the table. Other unique sets of columns are called Alternate Keys (AK).
    Oracle - DB2 - MS Access -

  4. #4
    Join Date
    Mar 2004
    Location
    Venice,Italy
    Posts
    20
    it can be usefull for logging purpose...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •