Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to calculate the daily and weekly averages using sql server or alternate sql softwares

How to calculate the daily and weekly averages using sql server or alternate sql softwares

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintoolstutorial
4 Posts 3 Posters 13 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Barath8357
    wrote on last edited by
    #1

    Hi, I need to insert all the records from an excel sheet to a sql database table and find out below through sql queries.Excel is attached for reference below device_id device_name appanalyticssessioneventid app_name category local_time 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c Galaxy S9 Plus 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c:2018-04-20T15:15:37.139UTC:2018-04-20T10:11:14.000 -0500 Robinhood Finance 4-20-2018 10:12:53 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc Galaxy S9 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc:2018-04-20T23:53:21.784UTC:2018-04-20T18:17:56.000 -0500 KNOX Configure Productivity 4-20-2018 17:53:02 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4 Galaxy S9 Plus 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4:2018-05-15T06:29:19.679UTC:2018-05-14T21:33:41.000 -0700 YouTube Entertainment 5-14-2018 21:45:19 [edit] Removed thousands of lines of the same text [/edit] a)Daily avg of app session count per device id b)How many times on an average user login to facebook app weekly Thanks, Barath

    Z M 3 Replies Last reply
    0
    • B Barath8357

      Hi, I need to insert all the records from an excel sheet to a sql database table and find out below through sql queries.Excel is attached for reference below device_id device_name appanalyticssessioneventid app_name category local_time 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c Galaxy S9 Plus 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c:2018-04-20T15:15:37.139UTC:2018-04-20T10:11:14.000 -0500 Robinhood Finance 4-20-2018 10:12:53 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc Galaxy S9 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc:2018-04-20T23:53:21.784UTC:2018-04-20T18:17:56.000 -0500 KNOX Configure Productivity 4-20-2018 17:53:02 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4 Galaxy S9 Plus 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4:2018-05-15T06:29:19.679UTC:2018-05-14T21:33:41.000 -0700 YouTube Entertainment 5-14-2018 21:45:19 [edit] Removed thousands of lines of the same text [/edit] a)Daily avg of app session count per device id b)How many times on an average user login to facebook app weekly Thanks, Barath

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      Are you insane!!!? You posted thousands of line of gibberish and then expected someone else to do all the work for you?!! Come on man!! Provide you credit card number and I'll gladly do this for you. :doh:

      Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

      1 Reply Last reply
      0
      • B Barath8357

        Hi, I need to insert all the records from an excel sheet to a sql database table and find out below through sql queries.Excel is attached for reference below device_id device_name appanalyticssessioneventid app_name category local_time 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c Galaxy S9 Plus 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c:2018-04-20T15:15:37.139UTC:2018-04-20T10:11:14.000 -0500 Robinhood Finance 4-20-2018 10:12:53 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc Galaxy S9 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc:2018-04-20T23:53:21.784UTC:2018-04-20T18:17:56.000 -0500 KNOX Configure Productivity 4-20-2018 17:53:02 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4 Galaxy S9 Plus 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4:2018-05-15T06:29:19.679UTC:2018-05-14T21:33:41.000 -0700 YouTube Entertainment 5-14-2018 21:45:19 [edit] Removed thousands of lines of the same text [/edit] a)Daily avg of app session count per device id b)How many times on an average user login to facebook app weekly Thanks, Barath

        Z Offline
        Z Offline
        ZurdoDev
        wrote on last edited by
        #3

        1. Thank you for cleaning up your question. 2. What exactly do you want us to do? You have several different requirements. You need to break them down into tasks and do each one.

        Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

        1 Reply Last reply
        0
        • B Barath8357

          Hi, I need to insert all the records from an excel sheet to a sql database table and find out below through sql queries.Excel is attached for reference below device_id device_name appanalyticssessioneventid app_name category local_time 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c Galaxy S9 Plus 1223593358dfa0030bfb23209fe2c93b8fe0f0ac2af363b9760e84d0ff2e926c:2018-04-20T15:15:37.139UTC:2018-04-20T10:11:14.000 -0500 Robinhood Finance 4-20-2018 10:12:53 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc Galaxy S9 1cab04b741fa186ddeb5145df7905eb918ad45a09638a3faac0a2c30d60c38bc:2018-04-20T23:53:21.784UTC:2018-04-20T18:17:56.000 -0500 KNOX Configure Productivity 4-20-2018 17:53:02 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4 Galaxy S9 Plus 102151dd863d3ac3f70ec3ed9aa105a847ebf02574300446911d567aa9f713f4:2018-05-15T06:29:19.679UTC:2018-05-14T21:33:41.000 -0700 YouTube Entertainment 5-14-2018 21:45:19 [edit] Removed thousands of lines of the same text [/edit] a)Daily avg of app session count per device id b)How many times on an average user login to facebook app weekly Thanks, Barath

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          You have just identified the groupings for your query. a) select the fields, group by date, appID, deviceID and do a count. b) identify the facebook appid, repeat A with a where clause filtering the appid.

          Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups