473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Query Multiple User-Defined Meta-Terms

I want to have people search for people by professional function, and limit that search to the areas in which the professional is willing to travel to/work in.
The areas are broken down into counties.
The professional can choose just one county - or up to 20 (possibly more - I haven't yet decided).

The professionals will be setting their own search meta terms. For example, a roofer might use [roofing, siding, windows, roofer, shingles, vinyl, aluminum, screen doors, gutters].

What I keep coming up with is creating one field with all the meta terms and having a separate table which lists one entry for each county the professional checks off.

So, User table would have:
UserID|UserName|MetaTerms|OtherPertinentStuff

The Locations table would have:
UserID|County
with an entry for each county the professional checked off.

If the professional said he is willing to travel to Passaic, Bergen and Morris counties in New Jersey for example, he would have three entries with his UserID in this table, each with a number for the county - which would be joined with a look-up table.
If he is willing to do the whole state, he can select that as well - or he can choose nationwide, in the case of Resume Writing, for example.
Each state would have a corresponding number in the look-up table, and nationwide (non location-specific) would have something like 99999.

And I would use a join on the tables to search for User.UserName, User.OtherPertinentStuff where Locations.County = {user's county} and MetaTerms Like %{user's query}%;

This doesn't seem terribly efficient, but I can't come up with anything better and I am far from a database engineer, so I was hoping for some guidance in working out something more efficient.

I hope I explained it well.

Thanks.
Apr 15 '09 #1
2 1849
Would I be better off with a MetaTerms table with one entry for each term each user enters?

AutoNumPK|UserID|Term
Apr 15 '09 #2
One suggestion I just got looks a lot better than what I have up there.
Please let me know what you think:


Try something like this:

TABLE: User
DESCRIPTION: Individual user.
PRIMARY KEY: [UserID]
FIELDS:
...UserID
...UserName

TABLE: Counties
DESCRIPTION: List of known counties.
PRIMARY KEY: [CountyID]
FIELDS:
...CountyID
...CountyName

TABLE: Professions
DESCRIPTION: List of known meta-professions.
PRIMARY KEY: [ProfessionID]
FIELDS:
...ProfessionID
...ProfessionName

TABLE: UserCounties
DESCRIPTION: A list of counties that some user is willing to work in.
PRIMARY KEY: [UserID with CountyID]
FOREIGN KEYS: [UserID], [CountyID]
FIELDS:
...UserID
...CountrID

TABLE: UserProfessions
DESCRIPTION: A list of professions that some user has.
PRIMARY KEY: [UserID with ProfessionID]
FOREIGN KEYS: [UserID], [ProfessionID]
FIELDS:
...UserID
...ProfessionID

RELATIONSHIPS:
User(1) -> UserCounties(n) <- Counties(1)
User(1) -> UserProfessions(n) <- Professions(1)
Apr 15 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matthew Braumiller | last post by:
On Thu, 2 Oct 2003, "Gary Floam" <floam@comcast.net> wrote: >Sure you can do that. The easies way is to create a table of the last names >selected, and join that table into the query definition....
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
4
by: carl.barrett | last post by:
Hi, I have a list box that displays 2 columns. Behind it sits a query with five columns. These are Column1 (DOB), column2 (a concatenated string of Surname Forname, Title), Column3 (Surname),...
0
by: hismail | last post by:
I am creating a vb.net service that will run AS SERVICE. There is actually a timer; so the timer will run every 2 minutes and see if there are any new ERROR type logs in the APPLICATION logs. And...
0
by: hismail | last post by:
1. hism...@dot-solution.net Aug 16, 2:51 pm show options Newsgroups: microsoft.public.vb.general.discussion From: hism...@dot-solution.net - Find messages by this author Date: 16 Aug 2005...
2
by: Jeff Gardner | last post by:
Greetings: I am attempting to split an input string using the str_word_count function to return multiple single word query variables. I can create an array based on...
13
by: john | last post by:
I have table User-App and table App Profile User-App App Profile IDuser IDApp IDApp 1 34 34 1 45 45 2 34 2 45 2 90 3 34
0
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in...
1
by: polyya | last post by:
Hi All, I'm working in Access 2000. Sorry for the long post, I'm trying to be as clear as possible. I've created junction tables to express M:M relationships for contractors and job task. ...
4
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.