title: Finding the most repeated value for each associated attribute
body: <p><br></p>
  
  <p>I'm practicing some SQL and I thought about the following problem:</p>
  
  <p>For each pub find the time when more people go.
  I have the following tables:</p>
  
  <pre>
              GOESTO
  id_person   id_pub  time
  1           1       Daytime
  2           2       Night time
  3           3       All Day
  4           1       Daytime
  5           2       Night time
  6           1       All Day
  7           3       Daytime
  8           3       Night time
  9           3       Night time
  10          1       Night time
  </pre>
  
  <pre>
           PUB
  id_pub  pub_name    cost
  1       pub1        123
  2       pub2        324
  3       pub3        345
  
  </pre>
  
  <p>What I want to get is something like the following:</p>
  
  <pre>
  pub_name   time
  </pre>
  
  <p>I think I should use MAX and COUNT functions, but I'm not quite sure how should I do it. It should work in an Oracle database.</p>
  
  <p>Thank you!</p>