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

  • Home
  • SEARCH
  • 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 187081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:45:36+00:00 2026-05-11T15:45:36+00:00

I’m creating an Access DB for use in an C# application at school. I’ve

  • 0

I’m creating an Access DB for use in an C# application at school. I’ve not had much experience working with DB’s so if this sounds stupid just ignore it. I want the user to be able to select all the classes that a certain student has had in our IT department. We have about 30 in all and the maximum that a person can take in 4 years of high school is 15. Right now my DB has 15 different columns for each class that a user could have. How can I compress this down to one column (if there is a way)?

  • 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. 2026-05-11T15:45:37+00:00Added an answer on May 11, 2026 at 3:45 pm

    Excellent question Lucas, and this delves into the act of database normalization.

    The fact that you recognized why having multiple columns to represent classes is bad already shows that you have great potential.

    What if we wanted to add a new class? Now we have to add a whole new column. There is little flexibility for this.

    So what can be done?

    We create THREE tables.

    One table is for students:

    Student    |-------------------------|    | StudentID | Student_Name|    |-------------------------|    |     1     |     John    |    |     2     |     Sally   |     |     3     |     Stan    |     --------------------------- 

    One table is for Classes:

    Class    ------------------------    | ClassID  | Class_Name|    ------------------------    |    1     |   Math    |    |    2     |   Physics |    ------------------------ 

    And finally, one table holds the relationship between Students and Classes:

    Student_Class    -----------------------    | StudentID | ClassID |    ----------------------- 

    If we wanted to enroll John into Physics, we would insert a row into the Student_Class table.

      INSERT INTO Student_Class (StudentID, ClassID) VALUES (1, 2); 

    Now, we have a record saying that Student #1 (John) is attending Class #2 (Physics). Lets make Sally attend Math, and Stan attend Physics and Math.

      INSERT INTO Student_Class (StudentID, ClassID) VALUES (2, 1);   INSERT INTO Student_Class (StudentID, ClassID) VALUES (3, 1);   INSERT INTO Student_Class (StudentID, ClassID) VALUES (3, 2); 

    To pull that data back in a readable fashion, we join the three tables together:

      SELECT Student.Student_Name,           Class.Class_Name    FROM Student,         Class,         Student_Class    WHERE Student.StudentID = Student_Class.StudentID         AND Class.ClassID = Student_Class.ClassID; 

    This would give us a result set like this:

      ------------------------------   | Student_Name  | Class_Name |   ------------------------------   |    John       |  Physics   |   |    Sally      |   Math     |   |    Stan       |  Physics   |   |    Stan       |   Math     |   ------------------------------ 

    And that is how database normalization works in a nutshell.

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

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 84k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can skip the whole X509 thing, after all you… May 11, 2026 at 5:04 pm
  • Editorial Team
    Editorial Team added an answer In your course object you need to set the cascade… May 11, 2026 at 5:04 pm
  • Editorial Team
    Editorial Team added an answer Most every app on the iPhone is made of a… May 11, 2026 at 5:04 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.