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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Classification and Search. Need advice on my appr

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2009-08-10 : 10:57:42
Hello,

On a database I have 2 main table Users and Posts.

1. A user can be a Professor, Student, ...
For this I added the tables Roles and UserRoles.
2. Each professor needs to be associated to Subjects and Grades that teaches
3. Each Post needs to be classified on Subject, Grade, Theme, ...

I started to have a very complex database ...
And implementing a Search in the future seemed to be more and more complex.

I am working on a new approach with two tables: Groups and Tags.
One Group can contain One to Many Tags.
A Group can be: Subject, Grade, Theme, ...

Then I associate Users and Posts to Tags using UsersTags and PostsTags.

How does this work? I have the following forms:

1. To create a Professor I have, for example, two fields:
Subjects with all Tags of Group Subject can be selected.
Grades with all Tags of Group Grade can be selected.
(I can even add a Themes DropDownList)
So the Professor can define what he or she lectures.

2. To create a Post I have a similar approach to 1.
So each post is associated to Subject, Grade, etc. ..

3. For a Student I have a similar approach to 1.
So each Student can select his or her interests.

This helps search. For example if a student selects Math and Primitives he will find all the Posts related to it and all the Professors that can help him.

Of course this search can also be done for Students.

This seems flexible enough and yet being able to classify everything.
And in the future I can add more Groups and Tags.

I added Groups mainly for the data input to be able to display only Subject, Grade or any other Tags types.

What do you think?

I can post my entire SQL code but at the moment I really need some advice or critic to my approach.

Thanks,
Miguel
   

- Advertisement -