0

Im going to create database.there are few table in that db.
I need to know what is the best ;
add more column to table or use separate table rather than add more column

3
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by JorgeM
0

Hi Sadun89,

This all depends on what you're trying to do with your database. Depending on the information provided in the tables, you can choose whether or not to add a table or a column. If you provide more info, we should be able to help you better.

0

Thanks seslie...
Actually i need just simple answer..
Thinks like that...If we need to record more data into table what you going to do??
put all record into same(related) group.. or divied its into groups(tables) as much as posible.?

What is your way..?

0

Hey Sadun89,

you're welcome. Let me use this example. I want to create a student result management system. I have a student table, which contains columns like;
Student_Id(PK), Registration_No, First Name, Last Name and Age.

I have another table called student_subjects, where i have ;
Subject_Id(PK), Name, Teacher

I have yet another table for student_results, where I have;
result_Id(PK), Student_Id(FK), Subject_Id(FK)

It wouldnt be good design to have this all muddled up into one table. So dividing it into tables serves us better.

So, what if you have to choose whether a subject is active or not for a term/semester? You could decide to have another table that has ;
SubjectStatus_Id(PK), Subject_Id(FK), Status (Bad Practice)

Or you could simply just add another column to the student_subjects table
Subject_Id(PK), Name, Teacher, **Status **

Try to read up on "Normalization" for more information

I hope i helped out a bit.

0

Thanks seslie,
I'm very sorry for delay replay, but anyway this asnwer help me to understand about my situation
lol ;-)

Edited by Sadun89

0

While most database designs benefit from normalization, there are some scenarios where you would not want or need to split your fields across multiple tables. More information would be needed to provide more feedback.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.