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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:30:52+00:00 2026-05-16T20:30:52+00:00

I am trying to develop a page to display student/class results by subject/teacher. Some

  • 0

I am trying to develop a page to display student/class results by subject/teacher.

Some classes have groups which contain students and some have only students. A subject is thought by one or more teachers. This may change in the future and I want to keep the design as flexible as possible (i.e. subjects might be broken into modules or into individual test results, classes might be further grouped by year etc)

I want to display the end results in a grid that I can expand and roll up to average out the results (class on the Y and subject on the X).

My though it to have 3 database tables as follows:

**class_structure**
id (int) PK
description (varchar)
parent_id (int) FK to id

The highest level would be the class (with no parent id) and the lowest level would be the student.

**subject_structure**
id (int) PK
description (varchar)
parent_id (int) FK to id

The highest level being the subject, lowest being the teacher

**results**
id (int) PK 
class_structure_id (int) FK
subject_structure_id (int) FK
date (datetime)
reult (int)

What do you think of the above structure? I believe this gives me flexibility going forward?

In my asp.net app then I query the highest class structure level and average out all the results below that (am I better to do this averaging in a sproc in the DB or use say LINQ in the app?)

This would give me back a set of results at the highest level.

Then I would need to display this is a table (i am thinking of just creating the table html in C#?) against the subject classes (i.e. create all the headers first and then try to place the result in the correct column (i am not sure how to do this though)).

<table border="1" padding="2">
 <tr>
  <td></td>
  <td></td>
  <td colspan="2" align="center">Subj 1</td>
  <td colspan="2" align="center">Subj 2</td>
 </tr>

 <tr>
  <td></td>
  <td></td>
  <td>Teacher 1</td>
  <td>Teacher 2</td>
  <td>Teacher 1</td>
  <td>Teacher 2</td>
 </tr>
 <tr>
  <td rowspan="2">Class 1</td>
  <td>Student 1</td>
  <td>90</td>
  <td>55</td>
  <td>75</td>
  <td>100</td>
 </tr>
 <tr>
  <td>Student 2</td>
  <td>40</td>
  <td>95</td>
  <td>65</td>
  <td>39</td>
 </tr>
</table>

Then when the user clicked on the first class, this would expand out and show all the groups (if any, students if not) (pass the class_structure_id of the clicked cell to the same method/sproc and get those results) and then redraw the table with an extra column.

Is this a good way to go about achieving what I am trying to do?

  • 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-16T20:30:53+00:00Added an answer on May 16, 2026 at 8:30 pm

    1:) Hierarchical data should not be displayed in a <table>, use nested <ul> or <ol> instead. Tables are for tabular data.

    2:) Since c# is an object oriented language, I would not reference the objects in the tree by an Id. Why not add a collection of child objects as a member a sample code pattern would be:

    class TreeElement 
    {
     public TreeElement Parent {get;}
     public IEnumerable<TreeElement> Children{get;};
     public AddChild(TreeElement element }
     public bool IsRoot { return Parent == null; }
     public bool IsLeaf { return Children.Length == 0; }
     public bool IsBranch {return !IsRoot && !IsLeaf; }
    }
    

    normally in a tree you don’t want to do a parent lookup. So if not needed leave all the parent references to avoid useless complexity 😉
    Try to insert stuff in the database in an object structure like above.

    3:) Key lookup according to your model will go eventually very slow in SQL. You ‘ll have to loop trough data and use if/else statements in your query
    On SQLTeam is a great sample on how to make that very fast with the use of an extra lineage column.

    4:) Use linq to query and generate the results for your data.

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

Sidebar

Related Questions

I'm trying to develop some web page in Asp.Net and C# which almost look
I'm trying to develop an application which uses HttpRequest for requesting a web page.
I am trying to develop a registration page which involves three separate information. First
I have a problem trying to develop a WPF page. I have a window
HI, I am trying to develop a form which has some user controls ,
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying to develop an application for my localhost on which I can
I was trying to develop a video management software for which I was evaluating
I am trying to develop the XMPP Gateway which can send/receive from standard XMPP
I was trying to develop a Chrome extension that can display me the last

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.