Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Hard one ... Relational Database queries SQL

LEGEND ,
Dec 09, 2006 Dec 09, 2006

Copy link to clipboard

Copied



OK - I wanted something a little odd, basically a relational design, where
there is a 1 to many relationship, i.e. where there are several pictures

field Pic1
field Pic2
field Pic3

And they all go to one table of pictures ...

Anyone know how to do this, I thought it would be easier, but I am
completely stumped.
Gerry


TOPICS
Server side applications

Views

249
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2006 Dec 09, 2006

Copy link to clipboard

Copied

I think we need a little more info as to what exactly you are trying to do.

It sounds like you want to assign X amount of photos to a particular "item"?



"G" <anom@NoWhere.ocm> wrote in message
news:elf2i6$bt$1@forums.macromedia.com...
>
>
> OK - I wanted something a little odd, basically a relational design, where
> there is a 1 to many relationship, i.e. where there are several pictures
>
> field Pic1
> field Pic2
> field Pic3
>
> And they all go to one table of pictures ...
>
> Anyone know how to do this, I thought it would be easier, but I am
> completely stumped.
> Gerry
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2006 Dec 09, 2006

Copy link to clipboard

Copied

G wrote:
> OK - I wanted something a little odd, basically a relational design,
> where there is a 1 to many relationship, i.e. where there are several
> pictures
> field Pic1
> field Pic2
> field Pic3
>
> And they all go to one table of pictures ...
>
> Anyone know how to do this, I thought it would be easier, but I am
> completely stumped.
> Gerry

That sounds like an unnormalised many-to-many, to me.

I would guess your current configuration is

Datatable
DataID
PicID1
PicID2
PicID3
DataDescription


All pointing to the Picture table

PictureTable
PicID
PicImageName
PicDescription

There shouldn't be any problems with getting that to work, but if you're
working with more than a few thousand records, you need to consider putting
a resolution entity in; change the Datatable to look like

DataID
DataDescription

Leave the Picture table as-is, and create a new table DataPicture, as
follows

DataPicture
DataID
PicID

And thats it. many-to-many solved.

It can be tricky getting this sort of design working in the Dreamweaver GUI,
but it's relatively simple if you hand-code it.

HTH,

Pete.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2006 Dec 09, 2006

Copy link to clipboard

Copied

LATEST

Sounds like I should try and go for a slightly different design approach..!

G


"PeteC" <noemailrequired@nospamrequired.co.uk> wrote in message
news:elffqq$dsj$1@forums.macromedia.com...
>G wrote:
>> OK - I wanted something a little odd, basically a relational design,
>> where there is a 1 to many relationship, i.e. where there are several
>> pictures
>> field Pic1
>> field Pic2
>> field Pic3
>>
>> And they all go to one table of pictures ...
>>
>> Anyone know how to do this, I thought it would be easier, but I am
>> completely stumped.
>> Gerry
>
> That sounds like an unnormalised many-to-many, to me.
>
> I would guess your current configuration is
>
> Datatable
> DataID
> PicID1
> PicID2
> PicID3
> DataDescription
>
>
> All pointing to the Picture table
>
> PictureTable
> PicID
> PicImageName
> PicDescription
>
> There shouldn't be any problems with getting that to work, but if you're
> working with more than a few thousand records, you need to consider
> putting a resolution entity in; change the Datatable to look like
>
> DataID
> DataDescription
>
> Leave the Picture table as-is, and create a new table DataPicture, as
> follows
>
> DataPicture
> DataID
> PicID
>
> And thats it. many-to-many solved.
>
> It can be tricky getting this sort of design working in the Dreamweaver
> GUI, but it's relatively simple if you hand-code it.
>
> HTH,
>
> Pete.
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines