SQL one to many?

So this is the problem I am trying to solve.

Category(CatID(PK), CatName,....)
Writer(wtrID(PK), CatID(FK), wtrName,....)
Report(rpID(PK), title)
Authors(rpID(FK),wtrID(FK))

how can I create a list to show the title of the Reports with Authors that come from exactly 3 different categories ?

Answers


select r.title, group_concat(w.wtrID) as writer_ids
from Reports r
inner join Authors a on a.rpID = r.rpID
inner join Writer w on w.wtrID = a.wtrID
inner join Category c on c.CatID = w.CatID
group by r.title
having count(distinct c.CatID) = 3

Need Your Help

inspecting the war file from inside after I have deployed the war file at google appengine

java google-app-engine java-ee war

After I have deployed my application on google app engine,is there a method I can see inside the folder present in the war. I have to check if a file is uploaded there. I mean can i inspect the war...