Top "Primary-key" questions

A key is a set of attributes that is irreducibly unique and non-nullable within a table.

Why is it not good to have a primary key on a join table?

I was watching a screencast where the author said it is not good to have a primary key on a …

ruby-on-rails database migration primary-key junction-table
MySQL ALTER TABLE on very large table - is it safe to run it?

I have a MySQL database with a MyISAM table with 4 million rows. I update this table about once a week …

mysql primary-key alter
How to save a UUID as binary(16) in java

I have a table TestTable with columns ID as binary(16) and name as varchar(50) I've been trying to store an …

java mysql primary-key uuid sql2o
What is the proper way to catch and handle ORA-00001 SQLException with JDBC?

I'm creating a simple form that stores entered data in an extremely simple Oracle database table via a Java Servlet …

oracle jdbc primary-key constraints ora-00001
Primary key value after insertion of row in SQL Server 2005

In SQL Server 2005 I am inserting a row into a table using a stored procedure and I want to fetch …

sql-server-2005 stored-procedures primary-key insert-update
PostgreSQL primary key length limit

What is the limit of the length of primary key column? I'm going to use varchar as primary key. I've …

postgresql primary-key varchar
What are the pros and cons of using multi column primary keys?

I would like to see an example of: When this is appropriate When this is not appropriate Is there a …

sql primary-key composite-primary-key
SQL Primary Key - is it necessary?

I have a list of items. Most of these items will not be in stock. The item table has id, …

sql key primary-key composite-key composite-primary-key
Creating index/pk in a huge table is taking too long. I am using Oracle. How do I know if it is going well?

I have a really huge table, with ~200 million rows. It had no index/pk at all. Selects in this table …

oracle indexing primary-key composite-primary-key
rails3 bigint primary key

I would like to create a bigint (or string or whatever that is not int) typed primary key field under …

ruby-on-rails ruby-on-rails-3 primary-key bigint