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

  • Home
  • SEARCH
  • 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 8769803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:25:55+00:00 2026-06-13T17:25:55+00:00

I’m working on a stat tracking webpage for a virtual hockey league on Xbox.

  • 0

I’m working on a stat tracking webpage for a virtual hockey league on Xbox. I have my basic table layout setup, but I am struggling with how to create the query that will allow me to show the schedule. Below is my basic table layout, and what I’d like to do is have it display something like:

Game 1:
New York vs Chicago
Detroit vs Boston

Game 2:
Boston vs New York
Chicago vs Detroit

SELECT homeTeam.name AS HOME_TEAMNAME
FROM GameSchedule Sched

INNER JOIN GameStats GameStatsHome
ON Sched.ID = GameStatsHome.gameSchedule_ID
AND Sched.homeTeam_ID = GameStatsHome.team_ID

INNER JOIN Team homeTeam
ON homeTeam.ID = gameStatsHome.team_ID

I realize where I’m running into the problem is trying to pull the Team.name for both GameSchedule.awayTeam_ID and GameSchedule.homeTeam_ID. But I haven’t been able to figure out how to do this. I feel like I’m close..but then again, I have no idea what I’m doing, and have spent about 3 days trying to figure this one query out. I think if someone can point me in the right direction, I should be good for the rest of what I need… Any help would be greatly appreciated.

Table: Team
-----------------------------------------------------------
| ID | name       | abbreviation | conference | division |
-----------------------------------------------------------
|  1  | New York  |      TMA     |      1     |     1    |
|  2  | Chicago   |      TMB     |      1     |     1    |
|  3  | Detroit   |      TMC     |      1     |     1    |
|  4  | Boston    |      TMD     |      1     |     1    |
-----------------------------------------------------------

Table: GameSchedule
------------------------------------------------
| ID | awayTeam_ID | homeTeam_ID | gameTime_ID |
------------------------------------------------
| 1  |     1       |      2      |      1      |
| 2  |     3       |      4      |      1      |
| 3  |     4       |      1      |      2      |
| 4  |     2       |      3      |      2      |
------------------------------------------------

Table: GameStats
------------------------------------------
| ID | gameSchedule_ID | team_ID | goals |
------------------------------------------
| 1  |        1        |    1    |   5   |
| 2  |        1        |    2    |   3   |
| 3  |        2        |    3    |   6   |
| 4  |        2        |    4    |   1   |
| 5  |        3        |    1    |   2   |
| 6  |        3        |    4    |   5   |
------------------------------------------
  • 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-13T17:25:56+00:00Added an answer on June 13, 2026 at 5:25 pm

    This will provide you both names

    SELECT
        away.Name as AwayTeam,
        home.Name as HomeTeam
    FROM
        Game_Schedule gs
        JOIN Team away ON t.ID = gs.AwayTeam_ID
        JOIN Team home ON t.ID = gs.HomeTeam_ID
    

    You can do whatever you want to in these joins!

    • 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 French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
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
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
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.