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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:05:41+00:00 2026-06-12T20:05:41+00:00

If I have a match table ( id , details) and team table (id,name)

  • 0

If I have a match table ( id , details) and team table (id,name) and I want to get all matches played by a given two teams.

My solution is:

Create a third table contains on (match_id,team1_id,team2_id)

Is this the best practice in this case ?

  • 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-12T20:05:43+00:00Added an answer on June 12, 2026 at 8:05 pm

    Assuming a match can be played only by two tables, the team1_id and team2_id should be part of the match table itself as attributes. A separate table is not needed. You can also define FOREIGN KEY relationship between team1_id and team table’s id and the same for team2_id also.

    A third table would be needed for a match that can be played by multiple teams and in such case the table structure would be (match_id, team_id) where there will multiple records with same match_id, i.e. one-to-many relationship between match table and match_teams table.

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

Sidebar

Related Questions

I have two tables : one table it matchs and the other is teams.
I have a table of data of personal details of clients: ID name addressID
I have a join which deletes rows that match another table but the joining
I have a table of golf match-ups taken from Betfair's downloadable CSV files of
I have a table let's say in the form of: match(id, hometeam_id, awayteam_id) and
I have to match two hashtable, but its keys does not match. So i
In SQL Server 2005, I have an order details table with an order id
I have one table reports, which contains all info and read reports which just
I have two tables +---------------------------------+ | Table A | +----------+-----------+----+-----+ | Part No |
I have two entities: match and player , which I have set up with

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.