Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 3rd, 2012, 07:38 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
Creating a Profiles model

This is both a question about a query to return the information and/or the model that I have laid out. The white parts of the ERD are already in place and cannot be changed. The yellow items are what I have come up with so far. See the attached image please.

As it stands now (again, cannot be changed) a lead is a sales lead and a sales lead may have characteristics tied to the person in the lead. These are things like age, location, etc. The characteristics table is already in place and does not need to be recreated for what I'm trying to do here.

I want to create groups of characteristics called a profile. For instance, a lead may have characteristics A, B, and C. A profile may be defined as containing characteristics A and C only, or A, B, and C, etc. I want to find all profiles (both of the above would work) that fit this lead.

I considered a table containing a ProfileID and a column for each characteristic, then a true/false for each of the columns for each profile. The problem with that is that if we add another characteristic the ProfileCharacteristics table itself must be modified and possibly queries rewritten, etc.

So, if what I have suggested in the attached ERD works can someone help me with linking a profile back to a lead in a query? If not, how do you suggest that I model this?

This is in SQL Server 2008, although I doubt it matters.

Thanks so much!
Attached Images
File Type: png ProfileCharacteristics.png (12.7 KB, 27 views)
__________________
Discontent is the first necessity of progress. - Edison

Reply With Quote
  #2  
Old January 3rd, 2012, 09:28 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
the ERD looks okay except that the characteristic table does not actually have a foreign key

am i right that you will feed into the query a leadid value? and you want to find all profiles that "fit" this lead?

please explain in more detail what "fit" means

i'm having a hard time understanding why a profile with A,C fits a lead with A,B,C
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old January 3rd, 2012, 09:37 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
Sure, no problem.

The characteristics table is just a list of info about a lead. I'm also using it the same way for profiles.

Yes, the lead ID will be part of the query. Really the guts of it is that I want a set of ProfileCharacteristics that are a subset (or full matching set) of the LeadCharacteristics for a given Lead.

The profiles are just combinations of characteristics. The reason A, C fits a lead with A, B, C is because the lead does include A and C. In this case the lead would fit two profiles. Does that help?

Reply With Quote
  #4  
Old January 3rd, 2012, 09:53 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
A coworker just suggested that I look into the PIVOT statement in SQL Server. Any thoughts on that?

Reply With Quote
  #5  
Old January 3rd, 2012, 10:13 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by mateoc15
The reason A, C fits a lead with A, B, C is because the lead does include A and C. In this case the lead would fit two profiles. Does that help?
not really

if i was looking for a love interest, and the characteristics i was looking for were cute, smart, and female, i would ~not~ be interested in a profile which was cute and smart but belonged to a guy named bruce

Reply With Quote
  #6  
Old January 3rd, 2012, 10:14 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by mateoc15
A coworker just suggested that I look into the PIVOT statement in SQL Server. Any thoughts on that?
none that i could repeat without using NSFW adjectives

Reply With Quote
  #7  
Old January 3rd, 2012, 10:19 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
Quote:
Originally Posted by r937
not really

if i was looking for a love interest, and the characteristics i was looking for were cute, smart, and female, i would ~not~ be interested in a profile which was cute and smart but belonged to a guy named bruce


Ok, then let's simplify. Let's say that the lead must match all characteristics. A lead with A, B, and C doesn't match a profile of just A, C. It does match a profile with A, B, and C. Does that make it easier or any different?

Why not the pivot? I did some research and it looks like you have to have an aggregate function and I'm not sure what the aggregate would be in this case. Can you help me there?

Thanks!

Reply With Quote
  #8  
Old January 3rd, 2012, 01:03 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by mateoc15
Ok, then let's simplify. Let's say that the lead must match all characteristics.
that's not a simplification, that's a change in your specs

just because somebody (me) doesn't understand why your specs are the way they are, doesn't make them wrong

i'm still trying to figure out what a lead is, and why you're trying to match a lead to a profile instead of the other way around

Quote:
Originally Posted by mateoc15
Why not the pivot?
because it's a hammer in search of a screw

Reply With Quote
  #9  
Old January 3rd, 2012, 01:51 PM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
A lead is something that we have generated through a much more detailed mining process that has been used for a long time. The profile is something we're considering using in the mining process if we can tie groups of characteristics to our success rates. We want to evaluate success rates by profile or group of characteristics. I should have clarified here.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Creating a Profiles model

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap