Top "Primary-key" questions

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

Django BigInteger auto-increment field as primary key?

I'm currently building a project which involves a lot of collective intelligence. Every user visiting the web site gets created …

python django primary-key auto-increment biginteger
newid() vs newsequentialid() What are the differences/pros and cons?

In a database where all of your primary keys are GUIDs, what are the differences/implications and/or pros and …

sql-server-2005 primary-key identity
MySql - Is primary key unique by default?

If I define a column as a primary key in MySql, is it also unique key by default or do …

mysql primary-key unique-key
Mysql primary key when using INSERT INTO ... ON DUPLICATE KEY UPDATE

My table structure is: CREATE TABLE IF NOT EXISTS `users_settings_temp` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userid` …

mysql primary-key insert-update database-table
Primary key Ascending vs Descending

In Sql Server, I have a table with an Identity primary key. Often I want the latest few new records, …

sql-server indexing primary-key
Why primary key is (not) required on fact table in dimensional modelling?

I have heard a few references that pk is not required on fact table. I believe every single table should …

database-design primary-key data-warehouse fact-table
Indexes and multi column primary keys

Went searching and didn't find the answer to this specific noob question. My apologies if I missed it. In a …

sql mysql primary-key indexing
Using Spring's KeyHolder with programmatically-generated primary keys

I am using Spring's NamedParameterJdbcTemplate to perform an insert into a table. The table uses a NEXTVAL on a sequence …

spring oracle10g primary-key jdbctemplate spring-jdbc
Best way to change clustered index (PK) in SQL 2005

I have a table which has a clustered index on two columns - the primary key for the table. It …

sql sql-server-2005 indexing primary-key clustered-index
Why can I create a table with PRIMARY KEY on a nullable column?

The following code creates a table without raising any errors: CREATE TABLE test( ID INTEGER NULL, CONSTRAINT PK_test PRIMARY …

postgresql constraints primary-key ddl postgresql-9.3