Reliable data

k31453

Registered User.
Local time
Today, 02:34
Joined
Jun 4, 2012
Messages
24
Hi i have a Table 1:

That has Enrolment, Max class size

I got another Table

That has a same field

It has Enrolment, max class size

The data of both table is same ..but i need a expression so that

If i change the value in Table 1

Emplyee or Max class size


i want it automatically that value changes into Table 2 fields

which is Enrolment , Max class size

For e.g I change the value of Enrolment in Table 1 to 20 to 15 i want..
that same change in Table 2 Enrolment as well automatically

does anybody know how do u do it ??
 
Databases shouldn't work like that, you don't store redundant data. Why have it in two places if the data should be the same? Why not store it in one place and just change it there?

My guess is you probably shouldn't even have 2 tables. Could you post the structure of both tables (i.e. field names, field types) and an explanation as to the purpose of each table?
 
My Table 1: List Of Available Classes

student id
Class
Teacehr Id
Subject ID
Subject
Description
Number of lessons
enrolment
max class size
action is Full OR available to enrol

Table 2 : Tutoring Income

Class
Teacher ID
enrolment
max class size
income per class


so i need enrolment and max class size in both table
 
You need to do some work on the tables. At a minimum, you need
tblPeople:
PersonID (autonumber PK)
FirstName
LastName
Teacher (y/n field to indicate that this person is a teacher. Teachers may also be students and so they belong in the same table)
etc.

tblClass:
ClassID (autonumber PK)
MaxClassSize
CostPerStudent
TeacherID (FK to tblPeople)
SubjectID (FK to tblSubject - not defined)
NumOfLessons
ClassDesc
etc.

tblClassRoster:
ClassRosterID (autonumber PK)
ClassID (FK to tblclass, unique index fld1)
PersonID (FK to tblPeople, unique index fld2)
FinalGrade
etc.

On the form where you enroll students, you count the existing enrollments to determine if the class is full or open.

The class roster is a junction table between classes and students. It is what allows you to have many students in one class and many classes for one student.
 

Users who are viewing this thread

Back
Top Bottom