Suppose I have the following schema, and for your information, I'm using MySQL:
Paper(paperId, title) Author(authorId, authorName) Paper_Author(paperId, authorId)
I design the tables like this because a Paper may have more than one Author and a Author may write more than one Paper.
I'd now like to get the title and all the authors of a Paper.
I've been wondering if I could do this in one single statement?
If it is a YES, then how? So far I have only come with an idea of trying to get an array of Authors right from MySQL.
If it is a NO, how can I do it to maintain the atomicity of the transaction? (Let's consider getting the title and the author as ONE transaction)
Edit - in response to Justin E's comment:
I'd like to get something like this:
array(
"title" => "ABC"
"authors" => array("Ken", "Kitty", "Keith")
)