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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:56:17+00:00 2026-06-03T08:56:17+00:00

I wasn’t sure what to put into the title for this…please read on… I

  • 0

I wasn’t sure what to put into the title for this…please read on…

I have a table of events with 3 days per event

eventID dayID
1       1
1       2
1       3
2       1
2       2
2       3

I also have a number of cars available for the event

carID regNum
1     fg12 bfr
2     gh34 vbn
3     kl56 thg
4     lm32 tfx

I would like to have certain cars available for certain events, for example carIDs 1,2 and 3 might be available for eventID 1 but only carID 4 is available for event 2.

I am unsure how to join these tables together.

I am looking at another table which defines which cars are available to which event for example

eventID carID
1       1
1       2
1       3
2       4

but I can’t work out how to join these 3 tables together to get the car list for event1 for example.

Any pointers gratefully received!

  • 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-03T08:56:19+00:00Added an answer on June 3, 2026 at 8:56 am

    Junction tables are the classic solution for modeling a many-to-many relationship in an RDBMS.

    You do not need to join three tables to get cars for event1 – two tables is enough:

    select *
    from Cars c
    join CarEvent e on e.CarId = c.CarId
    where e.EventId = 1
    

    If you need the event name, you need to join the event table as well:

    select *
    from Cars c
    join CarEvent ce on ce.CarId = c.CarId
    join Event e on e.EventId = ce.EventId
    where e.EventName = 'Event1'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wasn't sure how to title this, so please change it :) If I have
I wasn't even sure how to title this right. I have a page that
I wasn't sure exactly how to phrase the question Title. I have this block
I wasn't even sure how to phrase this so you'll have to forgive me
I wasn't sure how to phrase this so the title is a bit cryptic.
I wasn't sure what to title this question. Here's my goal: On page one,
Wasn't sure how to write a good title for this question... :) I'm new
I wasn't sure how to word the title to this well, apologies if the
Wasn't too sure exactly how to title this question, but here's the issue that
wasn't sure whether to put this in Software or here, so I figured I'd

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.