125k views
0 votes
When creating a database, in which step do you add foreign keys to tables?

when creating relationships within tables
when creating relationships between tables
when logically organizing data into tables and fields
when determining what data to store

User Tehreem
by
6.4k points

2 Answers

4 votes

Answer:

The answer to this question is "when creating relationships within tables".

Step-by-step explanation:

A foreign key use in column that refers to another table's column. The main purpose to use this key provides data referential integrity. In other words, we can say foreign key allows only values to appear in the database. and other options are not correct that can be described as:

  • foreign key provides a relationship within table not between table.
  • It not used for organizing data.
  • This key is not used for determining data.

User Meherzad
by
6.6k points
3 votes
The correct answer is when creating relationships between tables.The FOREIGN KEY constraint is defined in the CREATE TABLE statement. The foreign key is created in one table to reference the primary key of the related table.
User Paddy
by
6.4k points