Hi,

I would create one field (char(200) or char(255)) for all criteria.
After that I will store:
in the first byte of that string Y if hotel has swimming pool, N - doesn't
have, Q - no idea
in the second byte of that string Y if hotel has TV, N - doesn't have, Q -
no idea
in the third byte of that string Y if hotel has fitness club, N - doesn't
have, Q - no idea
...

After that I will be able to select from that table data according to my
criteria:
select * from Hotel where Criteria like 'NY_'

It means select all hotels that:
swimming pool - don't have,
TV  - have
fitness club - doesn't matter

Best regards,
Mikhail.


----- Original Message ----- 
From: "Lee Denny" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 3:17 PM
Subject: Database Design and Bianry Operations


> Hello,
>
> I'm after some advice on database design:
>
> I've got an object - for an example a hotel - and I want to keep
information
> about this hotel, criteria that it either has or hasn't (TV, swimming pool
> etc).
>
> I want to search on criteria and return the most appropriate match.
>
> Bearing in mind I've currently got over 200 criteria and want to expand
> this, how should approach the design of my criteria table.
>
> Should I have a table with Hotel Id and then a char(1) (Y/N) field for
each
> criteria and then a seperate look-up table for criteria name.
>
> I get the feeling there is a more efficient method using binary operations
> (only one field populated with zeros and ones) but I can't find anything
to
> help in the manuals.
>
> Any thoughts?
>
> Lee Denny
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to