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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:37:25+00:00 2026-06-11T07:37:25+00:00

I am trying to work with an Olympic database where I am tasked with

  • 0

I am trying to work with an Olympic database where I am tasked with modifying the information I know about Olympians who have tied in the same event.

“Firstly, extend the query to show more details about the event: in
place of the event id, display the event-gender, distance and style.
As part of this, the output is now to be sorted by event-gender,
distance, style. and then place.

Secondly, show more details about each of the two competitors: in
place of each competitor number, display their given and family names
and the name of their country (not the country code).”


The four tables that I have to work with are:

Competitors, which contains: CompetitornNum, Givenname, Familyname.

Results, which contains: Eventid, CompetitorNum, Place.

Events, which contains: Eventid, Eventgender, Distance, Style

Countries, which contains: Countryname

Is my original query.

SELECT C1.EventID, C1.Place, C1.CompetitorNum, C2.CompetitorNum
FROM Results C1, Results C2
WHERE C1.Place = C2.Place
    and C1.EventID = C2.EventId
    and C1.CompetitorNum < C2.CompetitorNum
ORDER BY C1.EventID;

My problem is that I have a notion as to what I need to do, but the program we have been told to use crashes every time I try something out, I really dont know where to go from here.

SELECT Eventgender, Distance, Style, C1.Place, Givenname, Familyname, Countryname,     Givenname, Familyname, Countryname
FROM Results C1, Results C2
    natural join Competitors
    natural join Countries
    natural join Events
WHERE C1.Place = C2.Place
    and C1.EventId = C2.EventId
    and C1.CompetitorNum < C2.CompetitorNum
ORDER BY C1.EventID;

I am looking to select the Givenname, Familyname and Countryname of person 1, and person 2 instead of the CompetitorNum I am currently retrieving.

My new query finds the first person, but I am not sure how to change to obtain the seconds persons information.

Any help would be greatly appreciated


I seem to have found a solution, however I am not sure if I am using the best method to accomplish the task. Is there a better way to do it?

SELECT C5.Eventgender, C5.Distance, C5.Style, C1.Place, C3.Givenname, 
C3.Familyname, C6.Countryname, C4.Givenname, C4.Familyname, C7.Countryname
FROM Results C1
    join Results C2 on C1.Place = C2.Place and C1.EventId = C2.Eventid 
        and C1.Competitornum < C2.Competitornum
    join Competitors C3 on C3.Competitornum = C1.Competitornum
    join Competitors C4 on C4.Competitornum = C2.Competitornum
    join Events C5 on C5.Eventid = C1.Eventid
    join Countries C6 on C6.Countrycode = C3.Countrycode
    join Countries C7 on C7.Countrycode = C4.Countrycode
ORDER BY C1.EventId;
  • 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-11T07:37:27+00:00Added an answer on June 11, 2026 at 7:37 am
    SELECT C5.Eventgender, C5.Distance, C5.Style, C1.Place, C3.Givenname, 
    C3.Familyname, C6.Countryname, C4.Givenname, C4.Familyname, C7.Countryname
    FROM Results C1
        INNER JOIN Results C2 on C1.Place = C2.Place and C1.EventId = C2.Eventid 
            and C1.Competitornum < C2.Competitornum
        INNER JOIN Competitors C3 on C3.Competitornum = C1.Competitornum
        INNER JOIN Competitors C4 on C4.Competitornum = C2.Competitornum
        INNER JOIN Events C5 on C5.Eventid = C1.Eventid
        INNER JOIN Countries C6 on C6.Countrycode = C3.Countrycode
        INNER JOIN Countries C7 on C7.Countrycode = C4.Countrycode
    ORDER BY C1.EventId;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to work out how to use constructors with an inherited class. I know
Trying to work out distance between two points (lat & lng) I have an
I´m trying to work out a problem with registering my configuration classes. I have
I've been trying to work wit the ZEND GData API in CakePHP and have
I am trying to work with json and I almost have what I need.
I'm trying to work on a toggle a div element currently has some information
I'm trying work with BitmapData class? and have some problems with assigning IntPtr value
Im trying to work out a url that will match domain.com\about-us\ & domain.com\home\ I
Im trying to work out the best way scale my site, and i have
I have been trying to work my way through Project Euler, and have noticed

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.