June 15, 2007 at 8:06 am
Hi Every One,
I am new to this forum.I have a database design issue that is I Possible please help me in my database design.in ui rating the will be entered for skill and task(skill one(n) and task one(n)) that is skills vs tasks ui will be in the following formate.i need to store the values in the database.can u suggest me with good database design
Tasks (INPUT B) Motivating your team Coaching and mentoring
skills (INPUT A)
Communication skills 3 3
Negotiating skills 0 1
Learning styles 3 3
Suneela
June 15, 2007 at 10:51 am
You didn't really provide enough information for a complete analysis of the data/situation to be modeled but assuming you need to end up with a grid similiar to what you displayed and that the "tasks"/"skills" are variable (i.e. are not limited to just what you provided) try something like this: (NOTE: Only the "create table" statements are important, the rest is just fluff to help evaluate the design).
if object_id('skills_tasks') is not null drop table skills_tasks
if object_id('tasks') is not null drop table tasks
if object_id('skills') is not null drop table skills
go
--Create the tables
create table tasks (id int not null identity(1,1), task varchar(40), primary key (id))
create table skills (id int not null identity(1,1), skill varchar(40), primary key (id))
create table skills_tasks (id int not null identity(1,1), task_id int, skill_id int, points int, primary key (id),
constraint fk_skills_tasks_01 foreign key (task_id) references tasks (id),
constraint fk_skills_tasks_02 foreign key (skill_id) references skills (id))
go
--load the tables with the data provided
insert into tasks (task)
select 'Motivating your team' union all
select 'Coaching and mentoring'
insert into skills (skill)
select 'Communication skills' union all
select 'Negotiating skills' union all
select 'Learning Styles'
go
insert into skills_tasks (task_id,skill_id,points)
select 1,1,3 union all
select 1,2,0 union all
select 1,3,3 union all
select 2,1,3 union all
select 2,2,1 union all
select 2,3,3
--Show some likely outputs
select task, skill, points
from skills_tasks st join skills s on st.skill_id = s.id
join tasks t on st.task_id = t.id
--James.
June 15, 2007 at 8:12 pm
Thank you very much james
Suneela
June 18, 2007 at 8:18 am
Your welcome. However I'd like to know if I just did you homework? If I did let me know what grade I got
If it wasn't homework I hope I helped, if it was please indicate in all future posts that you are working a homework assignment and post what you have of the solution. There are plenty of folks here (including myself) that will be happy to assist you in solving the problem (without doing all the work for you which doesn't result in you learning anything).
James.
June 22, 2007 at 5:30 am
See james..
I just Asked for the suggestion,i didn't ask you to create all these things.who doesn't know Creating tables and joins.i can do my home work well..there is no need for you to do it for me any way thanks for your help.
Thanks & Regards,
Suneela.
Suneela
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply