Question
What is a primary key in a relational database? Discuss its role in ensuring data integrity and how it differs from other types of keys. Include examples of when and why to use primary keys in your database schema.
Requirements
- Define what a primary key is.
- Explain its significance in maintaining data integrity.
- Provide examples of primary keys in common database scenarios.
- Discuss differences between primary keys and foreign keys.