Martyn Wendon wrote:

> Hi,
>
> I'm new to MySQL and indeed SQL in general (coming from an MS Access and
> Flat Text File background).
>
> I have data in text form at the moment of the following fields:
>
> ID (Auto increment)
> ARTIST (Text up to 255 characters long)
> DESCRIPTION (Text up to 255 characters long)
> PRICE (Decimal up to 000000.00 long)

CREATE TABLE table (
  id integer DEFAULT 0 NOT NULL AUTO_INCREMENT PRIMARY KEY,
  artist        varchar(255),
  description varchar(255),
  price           decimal( 8,2 )
  key( artist(20), description(20)),  -- for queries on just artist or artist
and description.
  key( description(20)),  --for queries on just desctiption
  fulltext( artist, description) -- for queries on FULL words anywhere in
artist and description
);

Read http://www.mysql.com/doc/C/R/CREATE_INDEX.html and
http://www.mysql.com/doc/F/u/Fulltext_Search.html to understand the indexes
better.

b.



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to