Loading ...
Sorry, an error occurred while loading the content.
 

Re: [baseball-databank] merging fielding and fieldingof tables

Expand Messages
  • Sean Forman
    Joe, It should be one-to-one with the outfield position entries. With your query you are matching fieldingOF with non-OF lines. I think we are missing a
    Message 1 of 2 , Jan 13, 2006
      Joe,

      It should be one-to-one with the outfield position entries.  With your query you are matching fieldingOF with non-OF lines.  I think we are missing a small handful of fieldingOF values.

      On 1/13/06, Joseph Adler <jadler@...> wrote:
      Hi everyone,

      I'm trying to merge the fielding and fieldingof tables, and have been
      coming up with slightly weird results. I assumed that each row in the
      fielidngof table should map to a unique row in the fielding table. So,
      I assumed that I could merge the tables by playerID, yearID, and stint.

      Unfortunately, I am finding that the correspondence is not unique:

      mysql> select count(*) from fieldingof;
      +----------+
      | count(*) |
      +----------+
      |    21603 |
      +----------+
      1 row in set (0.00 sec)

      mysql> select count(*) from
          -> (SELECT a.Glf, a.Gcf, a.Grf
          ->  from tempdb.fieldingof a inner join tempdb.fielding b
          ->  where a.playerID=b.playerID and a.yearID=b.yearID
          ->  and a.stint=b.stint) inr;
      +----------+
      | count(*) |
      +----------+
      |    39888 |
      +----------+
      1 row in set (2.36 sec)

      Am I interpreting the table definitions correctly (should I be able to
      merge by playerID, yearID, and stint)? Is there a problem with
      consistency within the fieldingof table (are stints repeated for the
      same playerid/yearid), or is the fieldingof table missing a key
      (probably teamID)?

      -- Joe






      http://www.baseball-databank.org/



      SPONSORED LINKS
      Mlb baseball Major league baseball Youth baseball
      Major league baseball ticket Baseball equipment


      YAHOO! GROUPS LINKS






      --
      Sincerely,        
      Sean Forman

      Baseball Stats!   http://www.Baseball-Reference.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.