title: SQL table in unix timestamp : calculate DAU
body: <p>There is an event log that records every time a user does an action on app.
  The event_log SQL table looks like this:</p>
  <p>Event_date_time : unix timestamp</p>
  <pre><code>user_id event_date_time Event
  7494212 1535308430 Opened app
  7494212 1535308433 Closed app
  1475185 1535308444 Registered
  6946725 1535308475 Opened app
  6946725 1535308476 Made a purchase
  6946725 1535308477 Closed app
  … …
  </code></pre>
  <p>…and it has over one billion rows.</p>
  <p>A) What will be the sql query to find DAUs, MAUs and DAU/MAU for July’19 [DAU = Users who opened app in a day, MAU = Users who opened app in a month]</p>
  <p>B) sql query to find average time spent by user on the app
  C) sql query to find Daily user retention (day-1) for July’19 [Day-1 retention = Users who registered on day - 0 and then opened app on day - 1]</p>