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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:38:22+00:00 2026-05-21T05:38:22+00:00

I am writing a web page that displays students grades in an old grade

  • 0

I am writing a web page that displays students grades in an old grade book format which is to say, it displays the Student name, then their score for each assignment (in a row) then repeats one row per student. My tables are set up as follows (shortened to necessary info):

Table: Assignment
* Assignment_PK (Primary Key)
* Assignment_Name

Table: Student

* Student_PK (Primary Key)
* Student_Name

Table: StudentAssignment
* SA_PK (Primary Key
* Student_FK (Student.Student_PK)
* Assignment_FK (Assignment.Assignment_PK)
* Score

I am trying to write a SELECT statement that will print the students name and score for each assignment. The problem I’m running into is that if I SELECT Score as a column, I only get the score for one assignment because in my WHERE Assignment_FK = Assignment_PK only allows me to pick one Score for a column.

I’m fairly new to Relational Databases and I could really use some help on the best way to tackle this. One suggestion was that I write a SELECT statement to pick all Students into a table, then do a foreach row in the table and have it select the scores and place them in the appropriate column. This seems like a slow and unnecessary process. Is there any easier way using JOINS? Or writing a better SELECT?

  • 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-21T05:38:22+00:00Added an answer on May 21, 2026 at 5:38 am

    This should get you the data you need. You can then investigate pivoting it into the desired display format, which may be easier in your application than in the database.

    SELECT s.Student_Name, a.Assignment_Name, sa.Score
        FROM Student s
            INNER JOIN StudentAssignment sa
                ON s.Student_PK = sa.Student_FK
            INNER JOIN Assignment a
                ON sa.Assignment_FK = a.Assignment_PK
        ORDER BY s.Student_Name, a.Assignment_Name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a web page that will detect which college campus a user is
I'm writing a simple web page that displays a table. It the right column
I am writing a web page that uses some php files. The php isn't
I'm writing part of a web page that allows a user to build a
I am writing a web page that has a vertical menu bar on the
I am writing a web page that selects certain fields from a database that
I am writing a app that has a UIWebView that displays a HTML5 page.
I am writing a web page that will display the content of a CSV
I am writing a web page widget for my company. This widget must inject
When writing a query for paging on a web page what is the least

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.