Check out example codes for "sql last 7 days". It will help you in understanding the concepts better.

Code Example 1

SELECT id, NewsHeadline as news_headline, NewsText as news_text, state CreatedDate as created_on
 FROM News 
 WHERE CreatedDate >= DATEADD(day,-7, GETDATE())

Learn ReactJs, React Native from akashmittal.com