Skip to main content

Questions tagged [primary-key]

In relational database design, a primary key can uniquely identify each row in a table. A primary key comprises a single column or a set of columns.

1 vote
1 answer
105 views

I am wondering why Postgres allows to insert a non-existing values for a foreign key to a nullable multicolumn unique constraint. (Cannot be an actual primary key.) I made a fiddle. I expected this to ...
Emaborsa's user avatar
  • 121
2 votes
1 answer
327 views

I have a SQL Server database with Change Tracking enabled on a hand full of tables and it's used by another application on the cloud to sync data between both databases. When an existing customer ...
MindDData's user avatar
  • 123
1 vote
0 answers
63 views

I am creating two tables called customer and item. For the customer table customerID is the primary key and for the item table itemID is the primary key. And I am creating another table which is ...
Charith Wirul's user avatar
0 votes
1 answer
61 views

I have a Products table, 2 options: Let the user type the PK because some users can input Barcodes or no (in this case, the app will let to user free to input anything for example his own code ...
Lund's user avatar
  • 3
0 votes
1 answer
44 views

I'm looking to design an application (Python with sqlite) which deals with some contributors moving across several groups through time. My design looks currently like (PK in bold weight, FK in italic, ...
Amessihel's user avatar
  • 103
0 votes
5 answers
201 views

I have a SQL Server log table that includes a column "Id" This is an identity column, but not a primary key, it is not even indexed. This would have just been set up from some tutorial for ...
F Dev's user avatar
  • 1
0 votes
0 answers
108 views

I have a log/audit table which the only index I will ever use is time window. Is it a good idea to PRIMARY KEY it as: CREATE TABLE events ( created TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT NOW(...
gcb's user avatar
  • 101

15 30 50 per page
1
2 3 4 5
50