Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8613457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:52:49+00:00 2026-06-12T04:52:49+00:00

I need to represent a form, called E-Report, where users will add data. Every

  • 0

I need to represent a form, called E-Report, where users will add data.

Every E-Report will have a QAP and every QAP will have two or more Defects.

These defects will show here, in this table:

enter image description here

At first time, this table will have two defects and user could add more defects from QAP, or insert new ones if he/she think that it is necessary.

User will check or not CRS, CRF, MA and MI columns and I will save these data on EReportDefect table.

By the way, QAP and Defect data will be in a web service, I need to download it to my Android device. I can’t modify these two tables adding more data.

To represent that I have designed this Visio:

enter image description here

Because I can’t add data to Defect table I’ve created EReportDefect table to store CRS, CRF, MA and MI user data and to store new Defects created by user.

To represent a new Defect added by user, I’ve set EReportDefect.defectId as NULL and EReportDefect.description to store new Defect description.

These new defects will have no value on EReportDefect.defectId and a value on EReportDefect.description.

Is this correct? Could I have a Foreign key column with a NULL value? Do you know a better approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:52:51+00:00Added an answer on June 12, 2026 at 4:52 am

    Nullable foreign keys are perfectly acceptable.

    Consider the following case, a messages table which is designed to be responded to by a user.

    CREATE TABLE Messages 
    (
      MessageId int,
      MessageText varchar(256),
      AnsweredByUserId int
    )
    

    Now, when the initial unanswered message is first created, AnsweredByUserId will be NULL. That’s perfectly fine. The message hasn’t been answered, so we wouldn’t expect to find a value in there.

    When someone does answer the message, we want to put their UserId into AnsweredByUserId, and we want to enforce referential constraints when that happens ( e.g. we want to ensure that the UserId we insert actually exists in our Users table ).

    In conclusion, fine to have a NULLABLE foreign key in the right circumstances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two fields on an MVC3 form that must represent the same value.
I need to represent huge data(37 columns,1000+ rows) in web. I would like to
I have the following Json collection and I need to represent it as a
I need to build a class that will represent a row in some table
Is it possible to have a Django form field represent form values as slugs
I have two instances of NSDate objects, they represent times of start and the
I have a file path in String form. In Java, I need to determine
I have following records in text file, need to extract that record form text
I need to build a form that shows data is the following format: M(1
So I have a checkboxlist on an ASP.NET form. I need the IDs of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.