Top "Primary-key" questions

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

Does the foreign keys automatically get updated as primary table is updated?

Above is my simple database design, just wanted to gain information about how things happen as I'm really new at …

sql-server database foreign-keys primary-key rdms
@@IDENTITY after INSERT statement always returns 0

I need a function which executes an INSERT statement on a database and returns the Auto_Increment primary key. I …

sql database ms-access primary-key jet
How do I retroactively add a primary key to my table in rails?

I've created a table without a primary key (:id => false), but now it has come back to bite my …

ruby-on-rails migration primary-key key
MySQL - Using foreign key as primary key too

I have table 1 with a primary key user_id and table 2 where user_id is a foreign key. Only 1 record …

mysql foreign-keys primary-key foreign-key-relationship primary-key-design
Identifying Sybase tables, fields, keys, constraints

I'm trying to set up a Sybase query that will give me the following output: Table KeyType KeyNumber Column table1 …

foreign-keys primary-key key sybase sysobjects
How to get primary key value with Entity Framework Core

We are currently using the method below which depends upon IObjectContextAdapter in an abstract Repository. From what I'm reading, it …

entity-framework primary-key repository-pattern entity-framework-core
Does making a primary key in multiple columns generate indexes for all of them?

If I set a primary key in multiple columns in Oracle, do I also need to create the indexes if …

oracle indexing primary-key multiple-columns
Transactional replication with no primary key (unique index)

I've just come across something disturbing, I was trying to implement transactional replication from a database whose design is not …

sql-server primary-key transactional-replication
Auto-increment on Azure Table Storage

I am currently developing an application for Azure Table Storage. In that application I have table which will have relatively …

concurrency primary-key azure-storage auto-increment identity-column
Why is negative id or zero considered a bad practice?

Why is negative id or zero considered a bad practice when inserting a primary key in a database table? I …

database database-design primary-key identifier least-astonishment