I have 3 SQLite tables:
channel
channelId triad
1 1
2 1
3 0
video
channelId videoId topic
1 xx 1
1 yy 0
2 pp 0
3 kk 1
comment
commentId replyId videoId sentiment
NULL er41 xx -3
clxpo NULL kk 0.05
clutz NULL yy 2.38
NULL edg15 xx 1.7
clopq NULL pp 1
dkt2 NULL kk 0.95
For every channel where triad = 1 I need to know the sum of the sentiment from the channel videos where topic = 1 and the number of comments for that channel.
Keys are:
channel.channelId = video.channelId
video.videoId = comment.videoId
End result should be:
channelId sum(sentiment) count(number of comments) triad topic
1 -1,3 2 1 1
How can I chain that 3 tables to get the needed result?