Top "Primary-key" questions

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

Why the auto_increment id does not increase one by one, how to set it?

I have a MariaDB Galera Cluster(3 nodes), I set uid to increase automatically and be the primary key of the …

mysql primary-key mariadb
How to choose the clustered index in SQL Server?

Usually the clustered index is created in SQL Server Management Studio by setting the primary key, however my recent question …

sql-server database-design sql-server-2008 primary-key clustered-index
Identity Column as Primary Key

Could you please opine if having identity column as primary key is a good practise? For ORM tools, having identity …

primary-key identity-column
Is there a simple way to create a unique integer key from a two-integer composite key?

For various reasons that aren't too germane to the question, I've got a table with a composite key made out …

tsql math primary-key uniqueidentifier composite-key
How to Query to Find out if a Table has a CLUSTERED Primary Key

I found this question, but it doesn't appear to answer the question... SQL Server - How to find if clustered …

sql tsql primary-key clustered-index
Primary Key Type: int vs long

I know some software shops have been burned by using the int type for the primary key of a persistent …

java persistence int primary-key long-integer
sql - check for uniqueness of COMPOSITE key

Can somebody please help me with this difficulty I am having? I would like to check some data whether it …

sql primary-key unique composite-primary-key
JPA map view with no primary key to an entity

I've got a database view with no primary key. It has a set of columns which uniquely identify a row …

java jpa primary-key composite-primary-key database-view
Can a primary key be empty? If yes why did this alter cause this result?

I have the following table: mysql> DESC my_contacts; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | …

mysql sql primary-key alter
Pandas to_sql make index unique

I have been readin about pandas to_sql solutions to not add duplicate records to a database. I am working …

pandas unique primary-key flask-sqlalchemy pandas-to-sql