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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:37:01+00:00 2026-05-26T02:37:01+00:00

Here is the query that I can not figure out how to do :

  • 0

Here is the query that I can not figure out how to do : “execute an SQL query that selects names of seniors, names of their mentors, and GPA in descending order of GPA-values.” The tables of my database are as follows:

Person (Name, ID, Address, DateOfBirth)

Instructor (InstructorID, Rank, Salary)

Student (StudentID, Classification, GPA, MentorID, CreditHours)

Other information that might be useful: The classification is a string, “Freshman” ect. The ID in Person is liked to the InstructorID and StudentID in their tables. Both instructors and students are in the person table. Students and Instructors can both be mentors(im not sure this matters). If you need any other information, let me know! Thanks!

  • 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-05-26T02:37:02+00:00Added an answer on May 26, 2026 at 2:37 am
    SELECT       SeniorDetails.Name AS SeniorName,
                 MentorDetails.Name AS MentorName,
                 Student.GPA        AS SeniorGPA
    
    FROM         Student
    
      INNER JOIN Person AS SeniorDetails
      ON         SeniorDetails.ID = Student.StudentID
    
      INNER JOIN Person AS MentorDetails
      ON         MentorDetails.ID = Student.MentorID
    
    WHERE        Student.Classification = 'Senior'
    
    ORDER BY     Student.GPA
    

    Assuming I understand you…[1]

    The Break-down:

    • INNER JOIN Person AS SeniorDetails
      • INNER JOIN tells sql it MUST have a match
      • the AS is to rename the person table (we need to since the Person table actually referenced twice in two separate joins)
      • Link the Person and the Student tables by the ID and StudentID, respectfully.
      • Reference the (now joined) SeniorDetails.Name value in to the select statement for returning
    • INNER JOIN Person AS MentorDetails
      • Again, must have a match
      • Rename it to MentorDetatails for clarity
      • Link the Person and the Student tables by the ID and MentorID, respectfully
      • Reference the (now joined) MentorDetails.Name value in the select stataement for returning
    • WHERE Student.Classification = 'Senior'
      • Only grab Students who are seniors
    • ORDER BY Student.GPA
      • Order the results by their GPA

    [1] The above answer is judged solely on the information I could attain from this revision. If I don’t get around to updating my answer for later revisions, please don’t kill me.

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

Sidebar

Related Questions

I have another script that I can't figure out what is wrong with it.
The problem itself is simple, but I can't figure out a solution that does
I can't figure out what's going on here. I've done a search and replace
Here is the query that I am working on: SELECT `unitid`, `name` FROM apartmentunits
Ok, here's a query that I am running right now on a table that
Here is the snapshot of the query that doesn't work since I added the
Here is the issue I am having: I have a large query that needs
Here is a silly question. Lets say I have a query that produces for
I found something that works with updating one field at here: http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-single-sql-query/ UPDATE person
First of all, please help me out! I can not take this anymore. I

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.