Jump to content

Relating Tables using REL_


FrobinRobin

Recommended Posts

Hi all, (my first time post :D )

 

I came across an example database where tables were related using REL_ and seperated by _ _ (double underscore i.e.  REL_table1__table2)

 

PHPMyAdmin reads the table as a collapsable tree and which I really like.

 

I only use this relation from my own interpretation (creating table1 on it's own, and only creating table 2 within the REL_ table)

so my table list would be:

table1

REL_table1

    REL_table1__table2

 

I've looked on the internet but cannot find any information on it? Can someone please point me in the right direction to learn how to use this correctly? (btw: I have rtfm)

 

Many thanks in advance!

Link to comment
Share on other sites

Thanks Effigy,

 

Would what I've done be considered incorrect or (more importantly) detrimental to my database?

 

table_a

ID, name

 

REL_table_a__table_b

ID, table_a_ID, description

 

SELECT table_a.name, table_b.description FROM table_a, REL_table_a__table_b WHERE table_a.ID = REL_table_a__table_b.table_a_ID

 

**Pls excuse my bad sql example**

I understand why not to use ID in the REL_ table (not needed as table_a_ID in the REL_ table is sufficient) - I may now remove it.

 

Also - what was your query for google? I cant seem to find the right words and I'd really like more information on the usage of "REL_" neither of your examples mentioned "REL_"

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.