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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:02:37+00:00 2026-06-17T21:02:37+00:00

I have two erds show me best way to access data from tables i-e

  • 0

I have two erds show me best way to access data from tables i-e

The table one is Category and table second is Articles

TWO Tables ERD

 Table Category 

(CategoryId
CategoryName
CategoryDescription );

Table Articles 


(ArticlesId
 ArticlesTitle
 ArticlesBody
 ArticlesCreatedby
 CategoryId (`forigen Key`FK));

i dont have that Reputation to Post Pics, but here is the link of the picture of diagramatic ERD.

http://i341.photobucket.com/albums/o377/pakistanihaider/relation1_zps06c6e6ec.png

OR

The table one is Category and table second is Articles and third one is Category & Articles

Three Tables ERD

Table Category

(CategoryId
CategoryName
CategoryDescription );


Table  Articles

(ArticlesId
 ArticlesTitle
 ArticlesBody
 ArticlesCreatedby
    );

Table Category & Articles

(Category_id
Articles_id);

Also Diagramatic ERD of this Second Code:

http://i341.photobucket.com/albums/o377/pakistanihaider/relation_zpsea5d55a9.png

  • 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-17T21:02:38+00:00Added an answer on June 17, 2026 at 9:02 pm

    It depends on your data. If you only ever need one category per article, then option one will work. However if you might in the future require more than one category per article, your second option is better. The one thing you are missing is the second option, the Category & Articles table should have both fields as foreign keys.

    The third table in the second option above is a joining table. It’s express purpose is to provide the links between the other two tables. This allows a many to many relationship (a category can have many articles, and an article can have many categories), whereas the first option only provides a one to many relationship (each article can only have one category).

    The reason both fields in the articles table should be foreign keys is because they will always relate to records in other tables. By setting them as foreign keys, you are protecting your data input (it will error if you try and enter and ID that is incorrect), and you are helping the database to optimise any queries you do joining the data.

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

Sidebar

Related Questions

Have two tables say ABC and XYZ and contain one column which data will
Have two sets of data (two tables) for patient records, one 1999-2003, the other
have two three tables one for student, second for class, and the third for
I have two classes (MVC view model) which inherits from one abstract base class.
I have two tables one with an add button and one without an add
I have two regular expressions, one pulling out usernames from a csv string, and
I have two mysql tables. One is a bad words list, the other is
Have two triggers on a table. One trigger is executed when there is a
Have two tables: CREATE TABLE IF NOT EXISTS `issue_details` ( `id` INT NOT NULL
I have two related tables, MANY and ONE. An integer ONE_ID column on the

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.