Q&A about the site for musicians, students, and enthusiasts
SELECT q.Id AS QuestionId, q.Title AS QuestionTitle, q.Body AS QuestionBody, a.Id AS AnswerId, a.Body AS AnswerBody, a.Score as Score FROM Posts q JOIN Posts a ON q.AcceptedAnswerId = a.Id WHERE q.PostTypeId = 1 -- Perguntas AND a.PostTypeId = 2 -- Respostas AND q.AcceptedAnswerId IS NOT NULL -- Perguntas com respostas aceitas