Member Avatar
  1. What exactly is a surrogate primary key?
  2. Is a surrogate primary key just a made up attribute inserted into a table by the database administrator?

All I know is that you use a surrogate key when there is no primary key or the natural key may not be a suitable primary key.

You pretty much have it correct. If no data lends itself to being a natural key (i.e. nothing int the data is unique across rows) a surrogate key needs to be supplied.
If you created a id column using [int auto_increment primary key] then you have a surrogate key because, although the column uniqiuely identifies each row, it has no real world realtionship with the data.
Using unique 'business' data means you are using a natural key e.g. social security numbers in a payroll database

commented: Thankyou sir +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.