473,396 Members | 2,011 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,396 software developers and data experts.

Multiple attribute design that need to be searchable

Hello,

I'm doing a school project and I'm supposed to be able to track campgrounds
and their amenities. Here is some of the information I'm supposed to store:

CAMPGROUND
Number of Sites Number
Summer Season End Date
Summer Season Start Date
Reservations Accepted Y/N
Firewood Rate Number
Quiet Hours Text
15 Amp Service Y/N
30 Amp Service Y/N
50 Amp Service Y/N
Cable/Satellite Hookup Y/N
Fire Pits Y/N
Flush Toilets Y/N
Free Parking Y/N
Handicap Access Y/N
Hot Showers Y/N
and so on and so on (there are quite a few amenities that I'm supposed to
track)

Now, the first thing I was thinking of was to store all of this in one table
and for each amenity they have, the value would be true, while the ones they
had would be false. Now, the problem with storing these attributes in the
same table means that I cannot add a "description", or a note with
additional information from the owner about the amenities, or even an image
if we'd like that displayed instead of the text. The way that I thought of
having that was to add the amenities, facilities, and restrictions (anything
that has a Y/N value above) into a "Features" table, then join a feature to
a campground with a CampgroundFeatureDetail table (then we could also group
the features by amenities, facilities, hookups, restrictions, etc. by adding
the CampgroundFeatureType table). This way, if a campground has a certain
amenity, then it will exist in the CampgroundFeatureDetail table with the
CampgroundID. This would also mean that by not entering each feature
manually into the campground table, it is much easier to add a new feature.
The data access layer won't need to be changed, as well as the HTML as the
data displayed would be dynamic.

The problem that I found with this technique is that if someone is using the
search form and tries to search for a site with multiple amenities (they
want a campsite with a Free Parking, Handicap Access, Hot Showers, Internet
Access, Paved Pads, Paved Roads, and that allows Pets, for example), then
the only way to find a campground that meets those requirements is if an
entry exists in the details table for that location. That produces a search
like this:

SELECT CampgroundID, NumberOfSites, etc...
FROM Campground
WHERE CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'F71881BF-E835-4117-AAB1-DE2619D493V')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'08D00648-D842-43DF-A238-A591FF14B044')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'9D9JF439-F2SD-F2V9-9N6G-G5F4F65L9KJ8')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'9L0HK43D-FJ39-90FD-LD90-FKJ342JKL98UJ')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'82LKJ342L-JK32-FD34-DF34-MJK9823JKN34')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'NM23442-FHD4-FDJ3-AS21-SAER532SAD34')
AND CampgroundID in (SELECT CampgroundFeatureDetailCampgroundID FROM
CampgroundFeatureDetail Where CampgroundFeatureDetailCampgroundFeatureID =
'JK324320-FDS3-FKL2-A348-DF23ZX43DF345')
....and so on for every feature they are searching for.

Now, what I'm concerned about is that this may make for a very slow search
if there are thousands of entries to search through because of the multiple
queries. I have a feeling that this may be a bad design. Does anyone know
of a better way of doing this?

Thanks,

Kevin
Jul 9 '08 #1
0 886

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fred | last post by:
I have a query that returns multiple identical records, however it should only return one. Indeed there is only one record for the OrderActionTypecode of 'P' yet there are two orderactions so it...
0
by: agrawal_rajesh | last post by:
Its interesting to know that We can create multiple interfaces in a single class in visiual studio 6.0 ATL. But I am surprised to see that we can't create the same in Visual studio .Net. In .Net...
11
by: charlie_M | last post by:
I have a number of applications where I want to have many onclick='submit()' attached to different 'elements' on a single form ..... which sends the form to a CGI "script" which does all the...
20
by: km | last post by:
Hi all, In the following code why am i not able to access class A's object attribute - 'a' ? I wishto extent class D with all the attributes of its base classes. how do i do that ? thanks in...
4
by: anonymous | last post by:
When I use the schema collection to apply many schemas to one XML instance document, I get an error if I do not qualify every element with the appropriate namespace. Both the W3C site and this...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
1
by: EricV | last post by:
I have been looking for a solution to the following problem: I have a databases with multiple searchable fields, and what I want to do is to design a query which will enable me to enter various...
1
by: natwong | last post by:
Hi All, I'm hoping that someone could help me out since I'm new with Access. Background: Database was set up as a simple data entry and reporting tool for Program Initiatives. The data...
2
by: Problematic coder | last post by:
I have a need in an application to have the ability to select multiple values in some kind of drop down list or maybe even a html type select box. I have found there doesn't seem to be an option...
1
by: Kevin | last post by:
Hello, I'm doing a school project and I'm supposed to be able to track campgrounds and their amenities. Here is some of the information I'm supposed to store: CAMPGROUND Number of Sites ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.