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 |
|
TazMania
Yak Posting Veteran
63 Posts |
Posted - 2005-12-05 : 10:19:02
|
Hi :)Sometimes you can stare blankly at a problem, well i'm just sitting here doing exactly that hehe..I need to design a db with the following categories.All with predefined data, so that i'm sure that there wouldn't be any duplicate data..table1 - Userdata ( initials )table2 - Projecttypes ( web,internal,external etc. ) - predefined datatable3 - elementtypes ( office,pc,server etc. ) - predifined datatable4 - specialtypes ( cad,sap,kalkule,br95 etc. ) - predifined data.table5 - systemtypes ( d4info,storage etc. ) - predifend data.My question is how can I design this database, since every user, can have more than one type.. f.ex.User1 have good knowledge in Projecttype ( web,internal ) and elementtype ( office ) and special type ( cad,sap,br95 )and systemtypes ( none )My first idea was to collect all data to table1, but would that be a smart idea since we are talking about +50 columns ?Below is how far i am..Table.UseruserID;int;4;priuserInit;varchar;4Table.ProjectTypeprojectTypeID;int;4;priprojectTypeLabel;varchar;50table.ElementTypeElementTypeID;int;4;priElementTypeLabel;varchar;50table.SpecialTypeSpecialTypeID;int;4;priSpecialTypeTxt;varchar;50table.SystemTypeSystemTypeID;int;4;priSystemTypeLabel;varchar;50I hope that some of you guys can help my out here, please :)Best regardsTaz  |
|
|
jhermiz
3564 Posts |
Posted - 2005-12-05 : 10:45:49
|
Not a good design.If you say each person can have more than one type then you need to store the UserID and the ObjectID in a seperate table, even if this is for multiple elements.Here is another thing you can do...All of those categories are types: Project, Element, System, and Special types.So instead of that many tables you create the following:Object-------ObjectIDObjectSample Data:1 System2 Project3 Element4 SpecialThen you create a another table that takes a typeID and a classification ID (classification can be in itself another table). If classification becomes another table, then you merge the two tables: Object and Classification into a 3rd table ObjectClassifications.Hope that gives you an idea.Jon Keeping the web experience alive -- [url]http://www.web-impulse.com[/url] |
 |
|
|
TazMania
Yak Posting Veteran
63 Posts |
Posted - 2005-12-06 : 09:52:58
|
Hi jhermizThx for your reply Do you mean that I should do as follows ?Table.useruserID;int;4;priuserInit;varchar;4Table.ObjectTypeObjectID;int;4;priObjectLabel;varchar;50It just crossed my mind, that I would have a problem to store the user specific data ?Since this database will have data of about 400 people.Or maybe I dont quite follow you jhermiz Sample data:User1- ProjectType(web,internal);elementtype(office);special(cad,sap,br95);systemtype(none)User2- ProjectType(external);elementtype(office,pc,server);special(cad,kalkule);system(storage)etc..Ofcourse the text, storage,office,pc,server would be exchanged with the corresponding id numbers of that object.Best regardsTaz |
 |
|
|
TazMania
Yak Posting Veteran
63 Posts |
Posted - 2005-12-07 : 02:12:18
|
Hi,I Finally figured it out, how to do it. with the help from array I can store the user selected data in each column :)Best regardsTaz |
 |
|
|
|
|
|
|
|