SQL TEST ASSISTANCE

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

Can anyone please help me with this?

Given two tables:

  1. posts

    id int

    title varchar(255)

    created_at datetime

  2. comments

    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


creating index on big table(s)

Updated September 03, 2018 18:06 PM


Linked Server Error on SQL Agent Job

Updated March 16, 2016 08:02 AM