Top "Primary-key" questions

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

Compound primary key in Table type variable

SQL Server 2008: DECLARE @MyTable TABLE( PersonID INT NOT NULL, Person2ID INT NOT NULL, Description NVARCHAR(100), CONSTRAINT PK PRIMARY KEY …

sql-server-2008 variables primary-key
Primary key for multiple column in PostgreSQL?

How to provide primary key for multiple column in a single table using PostgreSQL? Example: Create table "Test" ( "SlNo" int …

postgresql database-design primary-key ddl composite-primary-key
Django model instances primary keys do not reset to 1 after all instances are deleted

I have been working on an offline version of my Django web app and have frequently deleted model instances for …

django primary-key models instances
Using text as a primary key in SQLite table bad?

Is it bad to have text as a primary key in an SQLite database? I heard that it's bad for …

android database sqlite primary-key rowid
What size INT should I use for my autoincrement ids MySQL

Currently we're using INT(21)* for all autoincrement id columns in out 30+ table database. We are a blogging site, and have …

mysql primary-key auto-increment
What are the pros and cons for choosing a character varying data type for primary key in SQL?

In the databases course that I did during my education (approx. 4 years ago), I thought that it is recommended avoiding …

sql foreign-keys primary-key postgresql-9.1 sqldatatypes
Creating tables and problems with primary key in Rails

When I try to run the following code in Rails using Mysql2 as database manager: rake db:migrate I obtain …

mysql ruby-on-rails primary-key mysql2
Entity Framework Code First Migrations: Set Primary Key Value

I have a table that stores some extra data for some rows of a table like: public class QuoteExtra { [Key] …

ef-code-first primary-key entity-framework-5 entity-framework-migrations
Is it bad to use user name as primary key in database design?

I was told by a friend: What unique key do you use? I hope you are not saving the entire …

mysql database-design primary-key unique-key
How to get auto increment work on NAVICAT

I am using NAVICAT to make tables for MYSQL and I am unable to find the auto-increment attribute option for …

mysql primary-key increment navicat