开发者

Use DD view all_constraints to check if a FK constraint would work

开发者 https://www.devze.com 2023-04-05 20:09 出处:网络
My professor whom is teaching a database course asked the following question - currently I have no idea where to start as this seems like an unusual question to ask.

My professor whom is teaching a database course asked the following question - currently I have no idea where to start as this seems like an unusual question to ask.

I understand what foreign keys are and how they work, however I am not sure how to answer the below question:

ho and hi are public synonyms for two tables owned by the BLURP schema. Execute one query (even if nested, it can be considered as "one" query) on DD view all_constraints, and discuss whether or not table hi currently satisfies an FK constraint on column hi.olord.

Each column has identical value type CHAR(6) & NOT NULL constraint.

Any help would be ap开发者_高级运维preciated.


First, read the documentation about the all_constraints view.

My guess . . . You professor wants you to query the all_constraints view, and

  • determine whether there's a referential integrity constraint
  • from hi.olord
  • to some column in ho

And, in addition, he expects you to comment on the values you find in other relevant columns. I'd expect you to comment on STATUS and VALIDATED, among others.

If you worked for me, and I were testing you on this, I'd expect you to be able to justify why you included some columns in your query, and why you left others out. You might omit SEARCH_CONDITION, for example, because it applies to CHECK constraints, not to referential integrity constraints. You might include STATUS, because the issue of whether a particular constraint is enabled or disabled is relevant to determining whether "table hi currently satisfies an FK constraint on column hi.olord".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号