Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreign(T, U, Attrs) :-
- foreign_claim(T, U, Attrs),
- forall(member(A, Attrs), (attribute(A, T),
- attribute(A, U))),
- T\=U.
- foreign_key_path(T, T, []) :-
- table(T).
- foreign_key_path(T, U, [foreign(T, U, Attrs)]) :-
- foreign(T, U, Attrs).
- foreign_key_path(T, V, [foreign(T, U, Attrs) | Rest]) :-
- foreign(T, U, Attrs),
- foreign_key_path(U, V, Rest).
- attribute(custkey, customer).
- attribute(name, customer).
- attribute(address, customer).
- attribute(nationkey, customer).
- attribute(phone, customer).
- attribute(acctbal, customer).
- attribute(mktsegment, customer).
- attribute(comment, customer).
- attribute(nationkey, nation).
- attribute(name, nation).
- attribute(regionkey, nation).
- attribute(comment, nation).
- attribute(regionkey, region).
- attribute(name, region).
- attribute(comment, region).
- key_claim([custkey], customer).
- foreign_claim(customer, nation, [nationkey]).
- foreign_claim(nation, region, [regionkey]).
Advertisement
Add Comment
Please, Sign In to add comment