database - To get primary and foreign keys right in ERD -


I read my notes and now I am unsure about the keys.

My Logical Diagram

This table should correspond to the following physical ERD

I have only one foreign key table question .

I would like to know

  • question-id and in the question table question-tag-xref , And question-id and answers can also be a answer foreign key in the table? Masi - Logical models usually do not contain data types (string, int, Etc.), but this indicates that the attribute (a column is formed in the physical model) is optional (capable of being empty or not).

    He said, yes - question-id and question- TAG column QUESTION-TAG-XREF will be foreign key in the table. Here is a physical view of QUESTION-TAG-XREF:

    Question-Tag-Xref

    • Question-ID (with quiz PK, FK Relationships Table)
    • Question-Tag-Code (PK, FK Relationships with Quiz-Tag Tables)

    To ensure that both columns are PK That you can not duplicate tags for a given question.

    You are right that QUESTION-ID ANSWERS will be a foreign key in the table, in the context of the QUESTION table.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -