#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2

    Question & List Database Structure


    I'm making a website in which there's a table with questions.. And the user can make lists.. these list have questions that the user can choose from the questions list.

    So i'm thinking, what's the best way to achieve this.

    Lists -> id, name
    Questions -> id, name
    ListsQuestions -> list_id, questions_id
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,178
    Rep Power
    4274
    that will work fine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by r937
    that will work fine
    Allright. So what's the name of this kind of way of tables? these are not subtables right?
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,178
    Rep Power
    4274
    there are many names for this concept:
    • relationship table
    • association table
    • many-to-many table
    • intersection table
    • cross-reference table
    • junction table
    i prefer to say relationship table

    Comments on this post

    • notflip agrees
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo