Top "Primary-key" questions

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

Define a unique primary key based on 2 columns

I would like to define a unique key for records based on 2 columns : 'id' and 'language' to let the user …

ruby-on-rails primary-key composite-primary-key
String as Primary Key in Laravel migration

I've had to change a table in my database so that the primary key isn't the standard increments. Here's the …

php laravel migration primary-key laravel-artisan
Add primary key to PostgreSQL table only if it does not exist

I have simple table creating script in Postgres 9.1. I need it to create the table with 2-attributes PK only if …

sql postgresql primary-key alter-table postgresql-9.1
SQL Server: drop table primary key, without knowing its name

HI, Using: SQL Server Database: Northwind I'd like to drop a table primary key, without knowing the PK constraint name.. …

sql sql-server primary-key
Changing primary key int type to serial

Is there a way to change existing primary key type from int to serial without dropping the table? I already …

postgresql primary-key auto-increment
How to add a (primary) key to an existing table using SAP HANA

What is the SQL command to add a (primary) key to a table in SAP HANA? The ALTER TABLE docu …

key primary-key hana alter-table
is primary key automatically indexed in postgresql?

I have created table name as d with ID column as primary key and then just inserted records as shown …

postgresql indexing primary-key
Why does select SCOPE_IDENTITY() return a decimal instead of an integer?

So I have a table with an identity column as the primary key, so it is an integer. So, why …

sql-server primary-key scope-identity
How do you like your primary keys?

In a fairly animated discussion in my team I was made to think what most people like as primary keys. …

algorithm database-design relational-database primary-key ddl
Enforcement of unique/primary key - drop index

I am trying to drop an index : DROP INDEX PK_CHARGES but I get this error cannot drop index used …

oracle primary-key unique-index