Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-12-01 : 10:59:16
|
can somebody give me ideas abt the table design.I want to store the professor details(profid, name, email, courses (he offers)) in database.Should I use two tables: Professors (which stores profid, name, email). and prof_courses(which stores profid, courses) or one table.Thanks. |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-01 : 11:25:58
|
Can course exist without professor?Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-12-01 : 11:36:55
|
No it cant. |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-01 : 11:40:31
|
Then you can't have two tables.My mistake!!It's better to have two tables since it will avoid the duplication of other details of the professor table.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-12-01 : 12:09:24
|
If you say only one table is good, can you plz explain how to handle this situation: say professor "xxx" teaches two courses cs101 and cs102 then two records will be created and his personal information (email, name) are going to be redundant...isnt it???can you also plz explain why its not good to use two tables. |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2006-12-01 : 12:57:11
|
I would say you should NOT store courses and profs in the same table, for exactly the reason you say. if you do, you are duping the prof details for each course.also, it's pretty common in universities for courses to be taught by more than one prof, do you need to account for this? if so you need three tables because then it's many-to-many. SqlSpec: a fast and comprehensive data dictionary generator for SQL Server 2000/2005, Analysis Server 2005, Access 97/2000/XP/2003 http://www.elsasoft.org |
 |
|
|
|
|
|
|