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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:28:08+00:00 2026-05-10T14:28:08+00:00

Say I have a Student table, it’s got an int ID. I have a

  • 0

Say I have a Student table, it’s got an int ID. I have a fixed set of 10 multiple choice questions with 5 possible answers. I have a normalized answer table that has the question id, the Student.answer (1-5) and the Student.ID

I’m trying to write a single query that will return all scores over a certain pecentage. To this end I wrote a simple UDF that accepts the Student.answers and the correct answer, so it has 20 parameters.

I’m starting to wonder if it’s better to denormalize the answer table, bring it into my applcation and let my application do the scoring.

Anyone ever tackle something like this and have insight?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T14:28:08+00:00Added an answer on May 10, 2026 at 2:28 pm

    If I understand your schema and question correctly, how about something like this:

    select student_name, score from students   join (select student_answers.student_id, count(*) as score         from student_answers, answer_key         group by student_id         where student_answers.question_id = answer_key.question_id           and student_answers.answer = answer_key.answer)   as student_scores on students.student_id = student_scores.student_id where score >= 7 order by score, student_name 

    That should select the students with a score of 7 or more, for example. Just adjust the where clause for your purposes.

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

Sidebar

Related Questions

Let's say I have this: CREATE TABLE `classes` ( `class_ID` INT AUTO_INCREMENT, FOREIGN KEY
Let's say I have a Student and a School table. One operation that I
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
Lets say we have the table SP(sid, pid) which shows student sid is involved
Say I have an Excel spreadsheet containing student details and dates of courses the
Let's say I have a class of 30 students and want generate every possible
Lets say have this immutable record type: public class Record { public Record(int x,
Say I have a class definition: class CustomClass { int member; }; Why is
I am student of RDBMS. I have very basic question let say I have
I have a table named 'Attendance' which is used to record student attendance time

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.