Top "Primary-key" questions

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

Strings as Primary Keys in SQL Database

I am not very familiar with databases and the theories behind how they work. Is it any slower from a …

sql database database-design string primary-key
SQL Server: how to add new identity column and populate column with ids?

I have a table with huge amount of data. I'd like to add extra column id and use it as …

sql sql-server cursor primary-key
How to get primary key of table?

Is there a way to get the name of primary key field from mysql-database? For example: I have a table …

php mysql primary-key
Create view with primary key?

I create a view with following codes SELECT CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1' AS sno, YEAR(okuma_tarihi) …

sql-server tsql primary-key sql-view
How to retrieve the last autoincremented ID from a SQLite table?

I have a table Messages with columns ID (primary key, autoincrement) and Content (text). I have a table Users with …

database sqlite primary-key auto-increment junction-table
Can a foreign key refer to a primary key in the same table?

I just think that the answer is false because the foreign key doesn't have uniqueness property. But some people said …

sql foreign-keys primary-key
What is Hash and Range Primary Key?

I am not able to understand what Range / primary key is here in the docs on Working with Tables and …

hash amazon-dynamodb primary-key database nosql
Is there a REAL performance difference between INT and VARCHAR primary keys?

Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to …

mysql performance primary-key innodb myisam
Entity Framework and SQL Server View

For several reasons that I don't have the liberty to talk about, we are defining a view on our Sql …

entity-framework sql-server-2005 .net-3.5 primary-key sql-view