by Help Please   Last Updated October 19, 2019 02:06 AM

Can anyone please help me with this?

Given two tables:

  1. posts

    id int

    title varchar(255)

    created_at datetime


    id int

    post_id int

    comment_text varchar(1024)

    created_at datetime

Where post_id is the id of the post with which the comment is associated, and corresponds to an id in the posts table.

Write SQL to: Return the total number of comments 1.Find the title of the most recent post 2.Find the comment text of the most recent comment 3.Find the title of the post with the most recent comment 4.Return the number of comments on each post 5.Find the number of posts that have the word 'Phish' in their title 6.Find the total number of comments on posts that have the word 'Phish' in their title 7.Return a list of post titles, sorted from most recently created to least

Tags : sql-server

Related Questions

Updated September 03, 2018 18:06 PM

Updated October 14, 2019 10:06 AM

Updated March 16, 2016 08:02 AM

Updated July 10, 2018 15:06 PM

Updated April 17, 2019 14:06 PM