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 8529981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:09:11+00:00 2026-06-11T09:09:11+00:00

I’m developing an Android application and JSON web services. Both sides will have a

  • 0

I’m developing an Android application and JSON web services. Both sides will have a database, and both of them will have the same database schema.

On client side, Order, QAP and Defect are a copy from server side database. I can’t add more rows to those tables.

User will have a form with defect name and four columns: CRS, CRF, MA and MI. On these four columns user will insert some values. Defect’s name is Defect.description, and CRS, CRF, MA and MI values will be part of current E-Report.

To store these values (CRS, CRF, MA and MI) I use eReportDefect.

My problem is that user can add more defects. If I could add more rows on Defect table, I won’t have a problem, but I can’t. To solve it I have added UserDefect table but I’m not sure if this is a good approach because I have two tables, eReportDefect and UserDefect, almost identical.

And I have “another problem” for every Defect filled in an EReport, I could have zero, one or more images (tables eReportDefImg and UserDefImg).

Is this design “OK” or it could be improved?

enter image description here

  • 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-11T09:09:12+00:00Added an answer on June 11, 2026 at 9:09 am

    I can see some “old school” approach in primary key definition. 😉 Regarding the table eReportDefect your key is redundant, because as I understand “defectId” is already unique, so “qapId” and “eReportId” will only cause an index to be bigger thus slower – also the column positions in that case aren’t the best. It is correct within Defect and DefectImg tables, while the same mistake is within eReportDefImg.

    Ok, back to the point, if you can’t modify eReportDefect table there is no other way like create another table.

    Another thing, images. If I understand correctly you are able to modify table eReportDefImg, so there is no need for UserDefImg table and even for Image table. Instead of those three tables you can use one DefectImg table having:

    PK image_id
    FK userDefectId
    FK defectId
    

    If userDefectId IS NULL, then defectId IS NOT NULL and points to eReportDefect, and the other way around. This will save you storage and time consuming joins through UserDefectImg and eReportDefImg table. Those would be actually needed if one image could fit into more than one defects.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.