title: how to arrange my data in a star schema structure in PostgreSQL
body: <p>I’m not sure what would be the best way to arrange my data in a star schema structure with Postgres.</p>
  
  <p>Here are my tables:</p>
  
  <p>1) <strong>pages</strong> -  holds data on all page visits (every page a visitor clicked on during his visit to the website)
    2) <strong>sessions</strong>  -  holds data on sessions (e.g each time visitor has visited the website)
    3) <strong>countries</strong> - list of the counties 
    4) <strong>session_users</strong>  - list of the users and  attributes 
    5) <strong>daily aggregated</strong> table based on the tables above</p>
  
  <p>thanks </p>
  
  <p><strong>pages</strong>
  user_id
  session_id
  visitor_id
  session_country_id
  page
  website_type
  visitor_type
  seniority
  page_number
  end_date</p>
  
  <p><strong>sessions</strong>
  user_id
  session_id
  visitor_id
  visit_country_id
  operating_system_id
  days_since_first_session
  session_start_date
  session_end_date
  is_returning</p>
  
  <p><strong>session_user</strong>
  user_id
  signup_date
  account_user_id
  purchase_date</p>
  
  <p><strong>countries</strong>
  country_id
  country_name</p>
  
  <p><strong>session_user</strong>
  user_id
  signup_date
  account_user_id
  purchase_date</p>
  
  <p><strong>daily aggregated table</strong> 
  date
  num_of_visitor
  num_of_users
  num_of_sessions
  avg_num_of_pages
  advanced
  pricing</p>