Example of foreign key constraint - sql, PL-SQL Programming

Example of Foreign Key Constraint

Example: Alternative formulation for 6.3 as a foreign key constraint


ADD CONSTRAINT Must_be_enrolled_to_take_exam_alternative3

FOREIGN KEY (StudentId, CourseId)


The formulation in Example is available only because the following conditions hold:

  • There is a one-to-one correspondence from the specified columns, in the specified order, to those of the primary key of IS_ENROLLED_ON. Corresponding columns do not have to have the same name but they must be of the same declared type. The table name for the referenced table (IS_ENROLLED_ON in the example) can be followed by a commalist of column names in parentheses, in which case that commalist-the referenced columns-must correspond exactly, in the correct order, to some key specified for the referenced table. The referenced columns must be explicitly specified when the applicable key is declared using UNIQUE rather than PRIMARY KEY, or when it is declared using WITHOUT OVERLAPS.
  • The referenced table and the referencing table (EXAM_MARK in the example) are both base tables.
Posted Date: 1/18/2013 11:35:54 PM | Location : United States

Related Discussions:- Example of foreign key constraint - sql, Assignment Help, Ask Question on Example of foreign key constraint - sql, Get Answer, Expert's Help, Example of foreign key constraint - sql Discussions

Write discussion on Example of foreign key constraint - sql
Your posts are moderated
Related Questions
Overview of control structures According to the structure theorem, any computer program can be written by using the basic control structures as shown in figure below. They can b

Stored Subprograms Normally, tools (like Oracle Forms) which incorporate the PL/SQL engine can store subprograms locally for later, strictly local execution. Though, to become

Literals A literal is an explicit numeric, string, character, or Boolean value not represented by an identifier. Numeric literal 147 and the Boolean literal FALSE are some of

How Transactions Guard Your Database The transaction is a sequence of SQL data manipulation statements which does a logical unit of work. The Oracle treats the sequence of SQL

Advantages of Subprograms The Subprograms give extensibility; that is, tailor the PL/SQL language to suit your requirements. For illustration, if you require a procedure which

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op

Recursion The Recursion is a powerful method for simplify the design of the algorithms. Principally, the recursion means the self-reference. In the recursive mathematical serie

I need SQL Data Base Project Description: Network SQL database and SQL Setup two 4 workstation Skills required are Data Entry, MySQL, SQL

BIOCHE M ICA L ORIGIN OF LIFE - It is generally agreed by astronomers, geologists and biologists that the earth is approximately 4500-5000 million years old. It is an

Using LIMIT For nested tables, that have no maximum size, the LIMIT returns NULL. For varrays, the LIMIT returns the maximum number of elements that a varray can have (that yo