I understand that you are interested in whether a particular connection points to certain columns in FK, or is it a limitation, or perhaps has some other case or none of the foregoing. (And it is not clear what you mean by the “success” or “failure” of an affiliate or its relevance.) While focusing on this information, as explained below, is not to focus on more important and fundamental things.
The base table has a "value" or "predicate (expression)", which is an expression about spaces in the name (named-) specified by the database administrator. Operator space names are table columns. Lines filling in the blanks to make a true sentence about the world go to the table. Lines that fill in the blanks to make a false peace offer are not counted. Those. the table contains rows that satisfy its statement. You cannot set the base table to a specific value without knowing its statements, observing the world and placing the corresponding rows in the table. You cannot know about the world from the base tables except knowing its statement and accepting the sentences of the current row to be true and missing sentences as false. Those. you need his instructions for using the database.
Note that the typical syntax for declaring a table looks like a shorthand for its statement:
-- employee [eid] is named [name] and lives at [address] in ... EMPLOYEE(eid,name,address,...)
You can make larger statements by placing the logical operators AND, OR, AND NOT, EXISTS name, AND, etc. between / around other operators. If you translate the statement into a relationship / SQL expression by converting
- table instruction to her name
- And
JOIN - OR
UNION - AND NOT
EXCEPT / MINUS - EXISTS C, ... [...] -
SELECT all columns but C,... FROM ... - And the
ON/WHERE condition - ANSWER TO
SUBSETOF - IFF to
=
then you get a relation expression that evaluates the lines that make the statement true. (The UNION and EXCEPT / MINUS arguments need the same columns.) Since each table contains rows that match its expression, the query expression contains rows that satisfy its statement. You cannot find out about the world from the result of the request, except knowing its statement and accepting its real sentences in order to be true and absent sentences as false. Those. you need its expression to compose or interpret the request. (Note that this is true no matter what restrictions apply.)
This is the foundation of the relational model: table expressions compute strings that satisfy the corresponding operators. (To the extent that SQL is different, this is literally illogical.)
For example: If table T contains rows that make the operator T (..., T.Ci, ...) true, and table U contains rows that make the operator U (..., U. Cj, ...) true, then the table T JOIN U contains the rows that make the operator T (..., T.Ci, ...) and U (..., U.Cj, ...) true. This is JOIN semantics, which is important for using a database. You can always join, and the connection always matters, and it is always the value AND of its operands. Regardless of whether there are FK tables in others for others, this is not particularly useful for reasoning about updates or queries. (The DBMS uses restrictions when making errors.)
The conditional expression simply corresponds to the statement aka the always-true statement about the world and at the same time to one about the base tables. For example, for C UNIQUE NOT NULL in U following three expressions are equivalent to each other:
FOREIGN KEY T (C) REFERENCES U (C)EXISTS columns other than C T(...,C,...)
IMPLIES EXISTS columns other than C U(...,C,...)(SELECT C FROM T) SUBSETOF (SELECT C FROM U)
It is true that this means that SELECT C FROM T JOIN U ON TC = UC = SELECT C FROM U , i.e. a connection on FK returns the same number of rows. But what? The join value is still the same function of its arguments.
Whether a particular join in a particular set of columns is a foreign key is simply not suitable for understanding the meaning of the query.