> -----Original Message-----
> From: Rami Krayem [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 27, 2001 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Newbie - MySQL Question - Finding Unique Names in Column
>
>
> I have a listing of photos in a table as follows (not actual
> column names):
>
> Image Name, Image Width, Image Height, Band Name, Venue, City, State, Date
>
>
> I would like to have a list of the different bands with photos in the
> archive.  There may be 120 photos of any one band, but I would like to
> select the name of the band only one time and have it printed in the list.
> Is there a MySQL function that would do this, or should I just put the
> different bands into a separate table?
>
> Any help would be appreciated.

Split the table up into 3 tables, one for bands, one for pictures, and one
for the venue.

table_bands
fields---
band_id (pk)
band_name

table_pictures
fields---
picture_id (pk)
band_id (fk)
venue_id (fk)
picture_name
picture_width
picture_height

table_venue
fields---
venue_id (pk)
venue_name
venue_city
venue_state
venue_date


Read this and you can see how I came up with the tables.  Its covers the 4
Forms of Normalization.
http://www.newbienetwork.net/sections.php?op=viewarticle&artid=17



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to