Notes table is going to be where user save all student grades. I called it Notes but in database it calls STU_Grades. There is something i would like to mention teacher name is a dropdown list.
Thanks
Main Topics
Browse All TopicsHello,
Can you provide some help about linking two ranges of information in two related tables.
First table
Student(Student_ID, FirstName, LastName)
Second Table
Notes(Notes_ID, Student_ID, Grades, TeacherName)
Note: My database is in ms sql and and I'm using visual web developer with code behind c#. Also you can use either a panel, Details view or a form view for Student but necessary a grid view for Notes
They are related ( 1, n) I would like to open the page in read only mode and be able to see 1 student and its grades, navigate and be able to update, insert record in both the Form and the grid view. I have some good ideas but not able to complete it the way i want. Any help will begreatly appreciated. Please send sample with code behind c#
Thank you in advanced.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can just follow the concept of single theme tables which is essentially achieved on normalization to fifth normal form. First start with individual master tables i.e. single theme tables
First table
Student(Student_ID, FirstName, LastName)
Second Table
Notes(Notes_ID, Grades) - Assuming this is purely Grade related table and Notes_ID is basically Grade_ID.
Third Table
Teacher(Teacher_ID, TeacherName)
Now, grades are won by students in subjects, hence:
Fourth Table
Subject(Subject_ID, SubjectName)
Now denormalize/reverse normalize by understanding whether relational mapping is 1:1 or 1:n or n:n i.e. one:one or 1:many or many:many. 4 tables taken 2 at a time combinations are 6 which are:
Student:Subject = n:n
Student:Notes = n:n
Student:Teacher = n:n
Teacher:Subject = 1:n
Teacher:Notes = n:n
Subject:Notes = n:n
Based on this, have following tables as well without considering unused mapping:
Fifth Table
Student_Notes_Subject(Stud
Sixth Table
Student_Teacher(Student_ID
Fourth Table modified
Subject(Subject_ID, SubjectName, Teacher_ID)
Now simply analyze/relate referential integrity or foreign keys between PK and FK and see whether all above 6 combinational relations are intact. As per me, they are. But still it is better to populate data relationally and check the mapping to be correct.
You have not mentioned your primary keys and foreign keys.
If you are implying that:
Second Table
Notes(Notes_ID, Student_ID, Grades, TeacherName) is mixed i.e. Notes_ID is pointing to subject and Grades is what is obtained in them by students against teacher name, you are keeping only Student as the pure single theme master table. Now let us analyze the six mappings in this context:
For this mapping to work i.e.
Teacher:Subject = 1:n, you need to keep Notes_ID as unique in which case you cannot achieve the following:
Notes_ID(which is subject now):Student_ID = n:n
Notes_ID(which is subject now):Grades = n:n
But you still satisfy:
Student_ID:TeacherName = n:n
Grades:TeacherName = n:n
Student_ID:Grades = n:n
I have laid out the concepts with detailed examples. The more one normalizes or goes towards achieving single theme tables the less the redundancy and more the consistency and less the INSERT/UPDATE/DELETE anomalies. But even there is a scope for inconsistency to arise due to redundancy or incomplete normalization OR anomalies, one can avoid these by taking care in application and from back end SQL/programming level. But if your entities and relationships are wrong i.e. conceptual design is wrong, your logical and physical design unless corrected will also stand to err.
Hi,
The database is already in third form normal there is no need to foucus on normalization. The samples I'm currently looking for is little solution in asp.net that creates a form to insert or update record into two related tables in a database. I use Student and Notes as an exemple but it could be any two related tables
I'm using visual web developer and ms sql. That's all i need .... Or what to put in the button save and update to update the form and the grid view.
Hi,
Please review the attached sample page and see if this is in line with what you need. I have used two grids with Edit/Delete functionality and Insert functionality through the footer row. Please look at the attached pics on the data tables I set up as part of this test project. Normally I would keep most of the logic in code behind but in this sample most of it (apart from assigning the parameter values for inserting) is done declaratively.
Hi Wizard,
Thank you so much. your approach seems to solve my problem. However I don't like the idea the user is going to choose the student ID in a dropdown list which denied the concept related table. In your concept how the notes table can get the the studeant ID value automaticly from the table student. once that question answer i'm gonna accept your solution.
Thanks
Hi,
Not sure what you mean by "how the notes table can get the student ID value automatically from the table student"? In the solution presented, you don't choose the ID, you choose the name of the student but the notes table gets populated with the student ID, I thought that's what you were after?
/Carl.
Business Accounts
Answer for Membership
by: k_murli_krishnaPosted on 2009-11-06 at 11:10:46ID: 25762107
What does Notes represent, Subject? or notes he is taking in the class in which case it cannot relate with Grade and Teacher but can relate to student unlike the way it is related to all 3 like Subject.
You can as many master tables as required and keep only ID's for relation and no other duplication to minimize redundancy due to higher normalization and reduced INSERT/UPDATE/DELETE anomalies.