DevPinoy.org
A Filipino Developers Community
   

Need some advise... database anyone?

rated by 0 users
Answered (Verified) This post has 3 verified answers | 5 Replies | 3 Followers

Top 75 Contributor
17 Posts
Points 370
DJ_Mikey posted on 02-10-2009 5:06 PM

here's my situation. last time nag post ako about which programming language to use sa school registry system ko. well, finally i started it already. i used php and mysql.

but that's not the case. i need some opinion on how to work things around. sa program ko, i need to make command for students to be able to assess their subjects. parang start ng enrollement. help nyo naman ako mag visualize anong mga kailangan ko sa database ko. naguguluhan kasi ako kung kelangan ba ng isang table per student?(coz  i need to record their subject na take na nila).

i little bit of elightenment would do... thanks

Answered (Verified) Verified Answer

Top 50 Contributor
33 Posts
Points 380
Verified by marl

To start off, I think you should read about relational database concepts.

You won't need 1 table per student. Just 1 table to hold all student records (discounting DB normalization first at this point coz you really need to read more on db concepts heheh)

  • | Post Points: 40
Top 10 Contributor
1,036 Posts
Points 23,965
Verified by marl

one table per concept usually yan. like bawat student nasa isang table (e.g. students table). bawat prof nasa isang table (e.g. profs table). bawat subject nasa isang table (e.g. subjects table). then igu-glue mo sila (relationship) by making use of other tables. for example, pwede kang magkaroon ng isang table na studentsubjects, na nagrerelate sa mga subject na tinake-up ng student.

example nyan eto data mo sa students table:

ID LastName      FirstName
1  Batungbakal   Annie
2  Escalera      Joey

tapos eto naman sa subjects table mo:

ID SubjectName Description
1  MATH101     (may description dito)
2  ACCTG101    (may description ulit dito)

maaaring may studentsubjects table ka:

ID StudentID SubjectID
1  2         1
2  2         2
3  1         1

In this case, makikita sa studentsubjects table na si Joey Escalera (student ID 2) eh nagtake ng MATH101 at ACCTG101 (subject IDs 1 and 2) while si Annie Batungbakal (student ID 1) eh nagtake ng MATH101 (subject ID 1).

Example lang yan...basa-basa ka ng relational database concepts...then syempre dapat interview-hin mo yung registrar nyo at kung sino-sino pang domain experts (yung maalam sa ganyang sistema) para maka-come-up ka ng model given your problem set.

http://devpinoy.org/blogs/cruizer
Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
  • | Post Points: 40
Top 10 Contributor
365 Posts
Points 4,965
Verified by marl

Here are sample schemas that you can study:

http://www.microsoft.com/sqlserver/2005/en/us/express-starter-schemas.aspx 

Gaya nga ng sinabi nina BoyBawang at Cruizer, spend some time studying database relational concepts. Ok, inulit ko lang pala sinabi nila. Pero yung link 'tol ayos yan para magkaroon ka ng bird's eye view ng sinasabi ni Cruizer.

devpinoy sig

  • | Post Points: 25

All Replies

Top 50 Contributor
33 Posts
Points 380
Verified by marl

To start off, I think you should read about relational database concepts.

You won't need 1 table per student. Just 1 table to hold all student records (discounting DB normalization first at this point coz you really need to read more on db concepts heheh)

  • | Post Points: 40
Top 10 Contributor
1,036 Posts
Points 23,965
Verified by marl

one table per concept usually yan. like bawat student nasa isang table (e.g. students table). bawat prof nasa isang table (e.g. profs table). bawat subject nasa isang table (e.g. subjects table). then igu-glue mo sila (relationship) by making use of other tables. for example, pwede kang magkaroon ng isang table na studentsubjects, na nagrerelate sa mga subject na tinake-up ng student.

example nyan eto data mo sa students table:

ID LastName      FirstName
1  Batungbakal   Annie
2  Escalera      Joey

tapos eto naman sa subjects table mo:

ID SubjectName Description
1  MATH101     (may description dito)
2  ACCTG101    (may description ulit dito)

maaaring may studentsubjects table ka:

ID StudentID SubjectID
1  2         1
2  2         2
3  1         1

In this case, makikita sa studentsubjects table na si Joey Escalera (student ID 2) eh nagtake ng MATH101 at ACCTG101 (subject IDs 1 and 2) while si Annie Batungbakal (student ID 1) eh nagtake ng MATH101 (subject ID 1).

Example lang yan...basa-basa ka ng relational database concepts...then syempre dapat interview-hin mo yung registrar nyo at kung sino-sino pang domain experts (yung maalam sa ganyang sistema) para maka-come-up ka ng model given your problem set.

http://devpinoy.org/blogs/cruizer
Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
  • | Post Points: 40
Top 10 Contributor
365 Posts
Points 4,965
Verified by marl

Here are sample schemas that you can study:

http://www.microsoft.com/sqlserver/2005/en/us/express-starter-schemas.aspx 

Gaya nga ng sinabi nina BoyBawang at Cruizer, spend some time studying database relational concepts. Ok, inulit ko lang pala sinabi nila. Pero yung link 'tol ayos yan para magkaroon ka ng bird's eye view ng sinasabi ni Cruizer.

devpinoy sig

  • | Post Points: 25
Top 75 Contributor
17 Posts
Points 370

thanks guys... this one really helps.

dude, would you mind if i show you my finished product so all of you can comment on it?

  • | Post Points: 5
Top 50 Contributor
31 Posts
Points 400

Hi, Relational Database lng ung gagawin mo dito.

3 Tables ung gawin mo.

1. Student table - All the records of the students

2. Subject Table - All the Subjects in the school

3. Transaction Table - This table will save all the Students who have enrolled. Ung Primary key ng Students and Subjects table ayun ung magiging Foreign Key dito sa transaction Table.

 

hope it helps po..

  • | Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright DevPinoy 2005-2008