What is a surrogate key, and when would you use one?
Using the supplied customer dimension table, write a PostgreSQL query that returns the current records and demonstrates the surrogate identifier alongside the natural customer identifier.
surrogate_key, customer_code, customer_name, and source_system.customer_name ascending, then surrogate_key ascending.| Column | Type | Description |
|---|---|---|
| surrogate_keyPK | INTEGER | Warehouse-generated identifier for the dimension record |
| customer_code | VARCHAR(20) | Natural customer identifier from the source domain |
| customer_name | VARCHAR(100) | Customer display name |
| source_system | VARCHAR(40) | System that supplied the customer record |
| is_current | BOOLEAN | Whether the record is the current version |