[PHPwestoz] [OT] Relational SQL Databases

Timothy White weirdo at tigris.org
Tue Feb 22 16:35:02 UTC 2005


Nicolas Connault wrote:

> Timothy White wrote:
>
>>
>> Music.Artists
>> ID   |   Artist
>> 1    |   Avril
>> 2    |   Baxtar
>> 3    |   Zebra
>> ...
>> Music.Albums
>> ID   |   Album   | Artist
>> 1    |   Pink    | Baxtar
>> 2    |   Mouse   | Baxtar
>> 3    |   Rock    | Zebra
>> Music.Songs
>
>
> Tim,
>
> The design of your database doesn't take advantage of your ID fields.
> I suggest you change it to this:

Ok. I wasn't sure how to do relational stuff. As Evan said I don't need
innoDB to do this.
What would be the INSERT command that would insert the ID with out
needing a separate SELECT? Basically I don't want to do 2 SELECTs to get
the Artist and Album ID's for my INSERT for each song.
Along that note how can I do INSERT if not exists?

Thanks

Tim

--
Tim White - Use the Fox, Luke!
PGP/GPG id: 602E944D, Pub Key Serv: subkeys.pgp.net
Fingerprint: 04C2 9682 B7B2 3006 009D  A9F3 067E EDCD 602E 944D
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
--

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.linux.org.au/pipermail/phpwestoz/attachments/20050222/75ea5663/attachment.pgp 


More information about the PHPwestoz mailing list