Skip to content

Update SQL query for student report.sql based on grade rules #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ingenuim
Copy link

@Ingenuim Ingenuim commented Jun 3, 2025

Summary

This pull request updates the SQL query logic to match the specific business requirements set by Ketty:

  • Displays student names only if their grade is 8 or higher.
  • Replaces names with 'NULL' for students with grades less than 8.
  • Orders students by:
    • Grade in descending order.
    • Name alphabetically for grade ≥ 8.
    • Marks in ascending order for grade < 8.

Changes Made

  • Used INNER JOIN to match student marks with the correct grade range.
  • Added a CASE statement in SELECT to conditionally display names.
  • Implemented conditional logic in ORDER BY to sort differently based on grade level.

Why This is Needed

The logic ensures the report follows Ketty's formatting rules for visibility and sorting of student data, aligning with business expectations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant