Top "Primary-key" questions

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

Generating a non-sequential ID/PK for a Django Model

I'm on the cusp of starting work on a new webapp. Part of this will give users pages that they …

django url django-models primary-key
Add primary key to a table with many records

I have a table in SQL Server 2005 containing 10000054 records; these records are inserted through a bulk insert operation. The table …

sql-server primary-key bulkinsert
Create join table with no primary key

I have two tables with a many to many relationship that I am using has_and_belongs_to_many to …

ruby-on-rails join primary-key has-and-belongs-to-many
Composite PRIMARY KEY enforces NOT NULL constraints on involved columns

This is one strange, unwanted behavior I encountered in Postgres: When I create a Postgres table with composite primary keys, …

postgresql database-design null unique primary-key
Changing MySQL primary key when foreign key contraints exist

I have two already-existing tables which look (in part) roughly like this: CREATE TABLE parent ( old_pk CHAR(8) NOT NULL …

mysql foreign-keys primary-key constraints mysql-error-1025
Insert Where Not Exists-Without Primary Key

I have 3 tables: dentists, groups, and groupdentlink. Many dentists link to many groups through the groupdentlink table. So I'm trying …

mysql primary-key overwrite
Primary key in cassandra is unique?

It could be kind of lame but in cassandra has the primary key to be unique? For example in the …

cassandra primary-key create-table
PRIMARY KEY issue with creating tables in Rails using rake db:migrate command with mysql

My version of rails is 4.0.0, my version of mysql is Ver 14.14 Distrib 5.7.9, for Win64 (x86_64). I am operating of an …

mysql ruby-on-rails rake primary-key dbmigrate
How to get generated keys from JDBC batch insert in Oracle?

I am inserting many records using JDBC batch inserts. Is there any way to get the generated key for each …

java oracle jdbc primary-key batch-insert
Composite primary key

I am working on the design of a database that will be used to store data that originates from a …

sql database primary-key composite