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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:18:26+00:00 2026-06-01T20:18:26+00:00

A one to many relationship between two tables should be implemented with two or

  • 0

A one to many relationship between two tables should be implemented with two or three tables?
For example should we have:

author(id,otherAttributtes)
books(id,authorid,otherAttributes)

or

 author(id,otherAttributtes)
    books(id,otherAttributes)
    authorConnectsBooks(authorid,booksid)

I like more the first approach but i have seen the second and in more complicated applications a lot of times. Is there any downside for the first method, or it’s just personal which way to follow?

  • 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-01T20:18:27+00:00Added an answer on June 1, 2026 at 8:18 pm

    The first example shows a one to many relationship, while the second shows a many to many relationship.

    Example lets say we use the first example

    Author
    AuthorID
    
    Book
    BookID
    AuthorID
    

    How would you represent that both Jane and Jon wrote the book “Stackoverflow for fun”? In this relationship table you cannot, you have expressed that one author can write many books. So either Jane wrote it or Jon wrote it. If only one of them wrote the books you could use this relationship type. However, if you want to show that both wrote this book you need a many to many relationship.

    Now using this same analogy of Jane and Jon you can represent both authors to this one book using your second example – many to many relationship.


    Lets use Stackoverflow as an example starting with a one to many relationship and ending with a many to many relationship:

    Authors
    Joel
    Jeff
    
    Books
    Stackoverflow Joel
    

    Poor Jeff, he is not credited with stackoverflow from the above example…so we need to fix that:

    Author
    Joel
    Jeff
    
    Books
    Stackoverflow
    
    AuthorBooks
    Stackoverflow Jeff
    Stackoverflow Joel
    

    Now everyone’s happy…

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

Sidebar

Related Questions

I have a one to many relationship between two tables. The many table contains
I have a question about One-To-Many relationship between two tables when there is the
Is there a way to map one-to-many relationship between two tables that have the
I have a one-to-many relationship between two classes for this situation. I have a
I have two tables in a one to many relationship. (products and qty break
I have two tables: invoices & invoice_items. I need a one to many relationship
I have a 1 to many relationship between two tables... say Organisation and Members
I have two tables: messages (messages users posted), likes (many to many relationship between
I have a fairly simple Many to One relationship between two classes: @Entity public
In model first, when we create a one to many relationship between two entities,

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.