answersLogoWhite

0


Best Answer

Yes it could. It would have a primary key for its own use and it could then have a foreign linking it to another table. If it is only linked to one other table, then it would only need one foreign key. It is also possible to have the same foreign key linking to more than one table.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Could a table only have one primary key and only one foreign key?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is a foreign key field always on the one side of a one-to-many relationship between two tables?

No. The foreign key is always on the many side. A foreign key is a field that is a primary key in another table, not in the table it is in. It can therefore be repeated in the table it is, so it can act as the many side. In its own table, it is the primary key, and only appears once.


Can a column in a composite key be a foreign key to another table?

Hi, As per I know you can't define a foreign key column which is a part of a composite primary key of another table. Only way you've to refer all the columns of that composite key. UKD


How many primary keys can a table have?

A table can have only one primary key. But, it can have multiple unique keys.


How many primary key in table?

only one


What are Primary and Foreign Keys?

A primary key is a column which uniquely identifies the records in a table. In a broad sense, a primary key is the mixture of a unique key and an index: A collumn with a primary key is indexed to deliver a faster query, and doesn't allow duplicate values to ensure specific data. Most programmers recommend all tables having a primary key (and only one) to enhance the speed of queries and overall database performance. An example of a primary key may be found in a table named "departments," which might have a collumn named "department_number" that uniquely identifies each department in the table with a number. ---- A foreign key is a column (the child collumn) in a table which has a corresponding relationship and a dependency on another collumn (the parent collumn) that is usually in a different table. Parent collumns can have multiple child collumns, but a child collumn can only have one parent collumn. The child collumn is the collumn with the foreign key; the parent collumn does not have the foreign key "set" on it, but most databases require the parent collumn to be indexed. Foreign keys are made to link data across multiple tables. A child collumn cannot have a record that its parent collumn does not have. Say a table named "employees" has 20 employees (rows) in it. There are 4 departments in the "departments" table. All 20 employees must belong to a department, so a collumn in the "employees" table named "department" would point to the primary key in the "departments" table using a foreign key. Now all employees must belong to a department as specified by the "departments" table. If a department isn't specified in the "departments" table, the employee cannot be assigned to it.


What are the differences between primary key foreign key and candidate key?

A primary key is a column which uniquely identifies the records in a table. In a broad sense, a primary key is the mixture of a unique key and an index: A column with a primary key is indexed to deliver a faster query, and doesn't allow duplicate values to ensure specific data. Most programmers recommend all tables having a primary key (and only one) to enhance the speed of queries and overall database performance. An example of a primary key may be found in a table named "departments," which might have a column named "department_number" that uniquely identifies each department in the table with a number.A foreign key is a column (the child column ) in a table which has a corresponding relationship and a dependency on another column (the parent column ) that is usually in a different table. Parent columns can have multiple child columns, but a child column can only have one parent column. The child column is the column with the foreign key; the parent column does not have the foreign key "set" on it, but most databases require the parent column to be indexed. Foreign keys are made to link data across multiple tables. A child column cannot have a record that its parent column does not have. Say a table named "employees" has 20 employees (rows) in it. There are 4 departments in the "departments" table. All 20 employees must belong to a department, so a column in the "employees" table named "department" would point to the primary key in the "departments" table using a foreign key. Now all employees must belong to a department as specified by the "departments" table. If a department isn't specified in the "departments" table, the employee cannot be assigned to it.A candidate key would be any key which could be used as the primary key, which means that the combination of the columns, or just the single column would create a unique key. You would then need to determine which of these candidate keys would work best as your primary key.


What is a primary key what is its purpose and why do you use it?

A primary key is a unique identifier for each record in a database table. Its purpose is to ensure the uniqueness and integrity of the data within the table. It is used to uniquely identify each row, which allows for efficient data retrieval and modification, as well as establishing relationships between tables through foreign keys.


Can super key be as primary key?

I think super key is treated as the primary key because in a table their will be only one primary key.


Can a single MySQL column be referenced as a foreign key to multiple tables?

No. A foreign key may only point to only one collumn on one other table, and a collumn may only have one foreign key reference assigned to it.


Why would your pool table only have 4 wide corner pockets?

It is not a pool table if it only has 4 pockets. If the table is from the 1700's, it could be an antique pocket billiards table.


Could an omnivore be a consumer?

Yes it can, but only a primary consumer.


What is the differences between moral integrity and ennate integrity?

Moral integrity refers to adherence to ethical principles and values in one's actions and decisions. Ennate integrity, on the other hand, refers to an inherent or essential quality that is natural and unchanging. While moral integrity involves conscious choices and behaviors, ennate integrity is more about an innate state or characteristic.