text: Q:
  
  Authors, Articles, Magazines relationship in Relational Database [Doctrine]
  
  I have following entities:
  Author: Id, Name
  Article: Id, Title, Contents, Magazine_Id
  AuthorArticle: Author_Id, Article_Id
  Magazine: Id, Title
  Author - Article is Many to Many.
  What is the most efficient way to get the list of all the Magazines in which the Author's articles were published knowing the Author.Id.
  Are there better design options than this??
  Currently I first select all the Articles and the Select DISTINCT Magazine_ID from them.
  I am using Symfony2 and Doctrine so any specific things are also welcome.
  
  A:
  
  Do it in one select:
   Select distinct m.title from
      author, 
      AuthorArticle, 
      Article, 
      Magazine 
   where 
      author.id = AuthorArticle.Author_Id
   and
      Article.id = AuthorArticle.Article_Id 
   and
      Magazine.id = Article.Magazine_Id
   and -- at least
      Author.id ='my id'
  
  EDIT/APPEND (Are there better design options than this?)
  the design is ok, if an artikel can have more than one autor
  And as a naming design suggestion:
  name your key equal, ie:
  Author: author_ , Name
  Article: artikel_, Title, Contents, Magazine_
  AuthorArticle: Author_, Article_
  Magazine: Magazine_, Title
  
  this helps you prevent typos and selecting wrong ids with each other, you would get an error when selecting author_ from magazine, but not if you just join id
  
  