SQL Practice 4

SQL Practice 4

Sample Table UGC

Given following table

user_id content_id content_type target_id
1 1 post NULL
1 2 comment 1
2 3 comment 1
3 4 post NULL

Question

  • What is the total number of comments and total number of posts?
    2.what is the distribution of comments?.
  1. How to get the nick name of each facebook user suach david - dave , and if we already have the data how can we use it?