Question: What % of users want to keep using their current cloud platform by platform?
SQL:
SELECT Platforms.name, COUNT(Platforms.id) * 100.0 / count2 FROM Platforms JOIN Response_PlatformHaveWorkedWith ON Response_PlatformHaveWorkedWith.Platforms_id = Platforms.id JOIN Response_PlatformWantToWorkWith ON Response_PlatformWantToWorkWith.Response_id = Response_PlatformHaveWorkedWith.Response_id AND Response_PlatformWantToWorkWith.Platforms_id = Platforms.id JOIN (SELECT Platforms.name AS name2, COUNT(Platforms.id) AS count2 FROM Platforms JOIN Response_PlatformHaveWorkedWith ON Response_PlatformHaveWorkedWith.Platforms_id = Platforms.id GROUP BY Platforms.id) ON Platforms.name = name2 GROUP BY Platforms.id