answersLogoWhite

0


Best Answer

foreign key constraint defines a column or combinations of columns whose values match the primary key of another table.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the foreign key constraint?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What rule states that either each foreign key value must match a primary key value in another relation or the foreign key value must be null?

referential integrity constraint


Which type of data is used to explain a relationship?

A foreign key constraint is used to represent a relationship in a RDBMS (relational database management system).


What is mean by type constraint in DBMS?

A foreign key is a type of constraint. In this example the value in a field must be the same as some value in a defined field in another table. Example in a Customer Table you might have a Column (field) named StatusID You would define a foreign key to the table Status, field StatusID. The value in the Customer table, StatusID column must be an entry existing in the Status Table, StatusID column. There are many constraints. The fact that a column can not be NULL (Left blank) is a constraint. Defining what KIND of data, or range of data that can be entered in a column is a constraint.


When the primary key of one table is represented in a second table to form a relationship?

This is known as a "foreign key" (the data it points to is foreign to the current record). It is also commonly called a "foreign key constraint", usually in database systems where the database will perform additional data integrity checks when a primary key is updated or removed (such as restricting deletion of the primary record, clearing the value in the foreign key field, or cascading the deletion to the related records).


What the differences between primary key and foreign key?

A primary key is a special case of unique keys which doesnt accept duplicates. The difference between unique keys is that "NOT NULL" constraint is not automatically enforced, while for primary keys it is mandatoryUnique keys and primary keys can be referenced by foreign keys


What is primary key constraint?

Primary Key is a Constraint Used to avoid Duplicate entries in database table and you define primary key the column doesn't allow NULL values.


What is auto increment keys?

An auto-incremented key is a key (often used in a parent/foreign key constraint) that is generated automatically by a sequence number generator. The database provides the sequence generator, and generation/acquisition is wrapped in a transaction so that integrity can be preserved. Often, however, if a rollback is done, key values are lost, but this is not an issue in properly designed parent/foreign key relationships.


What is contraints?

Constraint, in Project Management terms, means a factor that affects when an activity can be scheduled. ------------------------------------------------------------------------------------------ It can be some kind of a limitation or restriction. webmaster at service.ztronics.com ------------------------------------------------------------------------------------------ Since this question has been categorised in Database Design, I will assume you mean what is a a constraint within a database... You can have primary key, foreign key, alternate key and domain (aka check) constraints. Domain contraints apply to a single field in a single row - e.g. whether or not nulls are allowed, or an enumerated list of allowed values. Primary keys and alternate keys ensure that a for the column(s) in the key each row in the table has a unique value (or set of values if the key is composite). Foreign keys ensure that if one table references another, that the reference exists in the parent table. This is normally linked to the primary key e.g. this example (Oracle syntax) demonstrates these create table employee ( employee_id number not null, first_name varchar2(100) not null, middle_names varchar2(100) null, last_name varchar2(100) not null, sex char(1), ni_number varchar2(10) not null, CONSTRAINT pk_employee PRIMARY KEY (employee_id), CONSTRAINT ak_national_insurance UNIQUE (ni_number), CONSTRAINT cc_sex CHECK sex in ('M', 'F') ); create table emp_salary_hist ( employee_id number not nul,l pay_review date not null, pay_grade number not null, salary number not null, CONSTRAINT pk_emp_sal_hist PRIMARY KEY (employee_id, pay_review), CONSTRAINT fk_employee FOREIGN KEY (employee_id) REFERENCES employee(employee_id) );


Which constraint type enforces uniqueness?

Primary key


What is the foreigh key in DBMS explainwith example?

In the context of relational databases, a foreign key is a referential constraint between two tables.[1] The foreign key identifies a column or a set of columns in one (referencing) table that refers to a column or set of columns in another (referenced) table. The columns in the referencing table must be the primary key or other candidate key in the referenced table. A table may have multiple foreign keys, and each foreign key can have a different referenced table. Each foreign key is enforced independently by the database system. Therefore, cascading relationships between tables can be established using foreign keys. Improper foreign key/primary key relationships or not enforcing those relationships are often the source of many database and data modeling problems.


Features of primary key?

* In NOT NULL constraint the particular data cannot be NULL,* In UNIQUE constraint the same thing cannot be repeated, it must be unique,* The primary key is simply the combination of both these constraints.


What is an auto incremented key?

An auto-incremented key is a key (often used in a parent/foreign key constraint) that is generated automatically by a sequence number generator. The database provides the sequence generator, and generation/acquisition is wrapped in a transaction so that integrity can be preserved. Often, however, if a rollback is done, key values are lost, but this is not an issue in properly designed parent/foreign key relationships.