What is a foreign key in a relational database?
Correct Answer: A foreign key is a field in one table that links to a primary key in another table.
- Step 1: Understand that a relational database is a way to organize data in tables.
- Step 2: Each table has rows and columns, where rows are individual records and columns are the attributes of those records.
- Step 3: A foreign key is a special type of column in one table.
- Step 4: This foreign key points to a primary key in another table.
- Step 5: The primary key is a unique identifier for each row in its own table.
- Step 6: By using a foreign key, we can link data between two tables.
- Step 7: This helps maintain relationships and ensures data integrity in the database.
No concepts available.