{"id":147,"date":"2017-09-29T13:07:54","date_gmt":"2017-09-29T20:07:54","guid":{"rendered":"http:\/\/www.ootp.cavebutter.net\/blog\/?p=147"},"modified":"2017-09-29T13:07:54","modified_gmt":"2017-09-29T20:07:54","slug":"batting-stats-2-easy-calculated-stats","status":"publish","type":"post","link":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147","title":{"rendered":"Batting Stats 2: Easy Calculated Stats"},"content":{"rendered":"<p>I&#8217;ll be adding to the scripts started yesterday working towards a complete script for all batting stats. \u00a0I&#8217;ll post the relevant bits of the code I&#8217;m working on in the main body and post the complete script as it stands beneath the fold.<\/p>\n<p>I&#8217;ll be tackling the easy calculated stats in this post, starting with batting average. \u00a0Easy and not worth a discussion.<\/p>\n<p>Next are K% and BB%. \u00a0These stats measure the percentage a player&#8217;s plate appearances end in a strikeout or walk, respectively.<\/p>\n<p>I made an interesting discovery while coding these easy stats. \u00a0As PA is a calculated stat, I was not looking forward to repeating the definition of PA <code>(AB+BB+IBB+HP+SF+SH)<\/code>. A minor annoyance, but for a reason that promises larger annoyances down the road. \u00a0I thought about how, in Wyers&#8217;s Run Value tables, we used variables that were defined and used in expressions in the same statement. \u00a0I figured it was worth a try. \u00a0I created a view with PA defined as <code>@PA := AB+BB+IBB+HP+SF+SH AS PA<\/code> and used <code>@PA<\/code> as the denominator in the expressions. I got an error telling me I couldn&#8217;t do that. Figures. But why? It worked for Wyers &#8211; so what was the difference? The only one I could think of was that he used his variables in creating a table and I used mine creating a view. So, I switched from a view to a table. It worked! Here are the relevant lines of code:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">DROP TABLE IF EXISTS CalcBatting;\r\n    CREATE TABLE IF NOT EXISTS CalcBatting AS\r\n\r\n   SELECT b.year\r\n    , b.league_id\r\n    , b.player_id\r\n    , b.stint #We can eventually move this down the list\r\n    , b.split_id #We can eventually remove\r\n    , b.team_id #We can eventually move this down the list\r\n    , l.abbr as Lg\r\n    , t.abbr as Team\r\n    , b.g\r\n    , b.ab\r\n    , @PA := b.ab+b.bb+b.sh+b.sf+b.hp AS PA\r\n    , round(b.h\/b.ab,3) AS ba\r\n    , round(b.k\/@PA,3) as krate\r\n    , round((b.bb+b.ibb)\/@PA,3) as bbrate\r\n   FROM \r\n      players_career_batting_stats b \r\n      INNER JOIN leagues l ON      b.league_id=l.league_id \r\n      INNER JOIN teams t ON b.team_id=t.team_id\r\n   WHERE b.ab&lt;&gt;0 AND b.split_id=1\r\n   ORDER BY b.player_id, b.year<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>On Base Percentage is next and, since I&#8217;ll be using that stat again in this statement, I decided to define it as a variable as well: <code>@OBP := round((b.h + b.bb + b.hp)\/@PA,3) AS obp<\/code>. This worked nicely, giving me identical results to when done without a variable.<\/p>\n<p>Next up is OBP+. \u00a0Not a very often used stat, and not present in OOTP, but I like it. \u00a0It presents a player&#8217;s OBP in relation to the rest of the league average which is set to 100. \u00a0So, a player with a 103 OBP+ is 3% higher than league average. \u00a0wOBA is always relative to what the current league OBP is, so for any nuanced understanding of a player&#8217;s wOBA you need to have an understanding of what the current league OBP is. \u00a0Don&#8217;t get me wrong, wOBA is one of the first offensive stats I look at, but for a quick glance at the rate a player gets on base vs the rest of the world, OBP+ is great.<\/p>\n<p>The formula for OBP+ is: 100 * (On Base Percentage \/ League On Base Percentage).<\/p>\n<p>Remember, we calculated League wOBA in the <a href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/122\">Intermediate Run Values Table<\/a>\u00a0and referenced it in the table <a href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/132\">RunValues2<\/a>, so we can call that up pretty easily. We&#8217;ll have to add another join to our statement, and that will give us:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">DROP TABLE IF EXISTS CalcBatting;\r\n    CREATE TABLE IF NOT EXISTS CalcBatting AS\r\n\r\n    SELECT b.year\r\n    , b.league_id\r\n    , b.player_id\r\n    , b.stint #We can eventually move this down the list\r\n    , b.split_id #We can eventually remove\r\n    , b.team_id #We can eventually move this down the list\r\n    , l.abbr as Lg\r\n    , t.abbr as Team\r\n    , b.g\r\n    , b.ab\r\n    , @PA := b.ab+b.bb+b.sh+b.sf+b.hp AS PA\r\n    , round(b.h\/b.ab,3) AS ba\r\n    , round(b.k\/@PA,3) as krate\r\n    , round((b.bb)\/@PA,3) as bbrate\r\n    , @OBP := round((b.h + b.bb + b.hp)\/@PA,3) AS obp\r\n    , round(100*(@OBP\/r.woba),0) as 'OBP+'\r\nFROM \r\n      players_career_batting_stats b \r\n      INNER JOIN leagues l ON b.league_id=l.league_id \r\n      INNER JOIN teams t ON b.team_id=t.team_id\r\n      INNER JOIN tblRunValues2 r ON b.year=r.year AND b.league_id=r.league_id\r\n    WHERE b.ab&lt;&gt;0 AND b.split_id=1\r\n    ORDER BY b.player_id, b.year<\/code><\/pre>\n<p>I&#8217;m going to stop here for now as I&#8217;ve hit a little snag. \u00a0My calculations for OBP aren&#8217;t matching up 100% against the ones that the game gives us. \u00a0Only off a couple points for full-season samples but much more with smaller ones. \u00a0I&#8217;d like to at least understand what&#8217;s happening, if not correct it, before moving on much further. \u00a0I posted about it <a href=\"http:\/\/www.ootpdevelopments.com\/board\/showthread.php?t=281650\">here<\/a>, and maybe the community can help me figure out the issue. \u00a0Spot checking a few players in both my database and the game, evaluating it in Excel has shown me that my database is calculating the formula correctly. \u00a0So, maybe the game is using a different formula?<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"150\" data-permalink=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147\/obp-wierdness\" data-orig-file=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?fit=524%2C319\" data-orig-size=\"524,319\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"OBP Wierdness\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?fit=524%2C319\" class=\"alignnone size-full wp-image-150\" src=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?resize=524%2C319\" alt=\"\" width=\"524\" height=\"319\" srcset=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?w=524 524w, https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?resize=300%2C183 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>Here&#8217;s where we stand with the script. \u00a0The parts commented out in front of the FROM clause haven&#8217;t been updated from when I was fooling around with this in Lahman and Access and should be ignored.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">#Calculated batting stats for OOTP\r\n    DROP TABLE IF EXISTS CalcBatting;\r\n    CREATE TABLE IF NOT EXISTS CalcBatting AS\r\n\r\n    SELECT b.year\r\n    , b.league_id\r\n    , b.player_id\r\n    , b.stint #We can eventually move this down the list\r\n    , b.split_id #We can eventually remove\r\n    , b.team_id #We can eventually move this down the list\r\n    , l.abbr as Lg\r\n    , t.abbr as Team\r\n    , b.g\r\n    , b.ab\r\n    , @PA := b.ab+b.bb+b.sh+b.sf+b.hp AS PA\r\n    , b.r \r\n    , b.h\r\n    , b.d\r\n    , b.t\r\n    , b.hr\r\n    , b.rbi\r\n    , b.sb\r\n    , b.cs\r\n    , b.bb\r\n    , b.k\r\n    , b.ibb\r\n    , b.hp\r\n    , b.sh\r\n    , b.sf\r\n    , b.gdp\r\n    , round(b.h\/b.ab,3) AS ba\r\n    , round(b.k\/@PA,3) as krate\r\n    , round((b.bb)\/@PA,3) as bbrate\r\n    , @OBP := round((b.h + b.bb + b.hp)\/@PA,3) AS obp\r\n    , round(100*(@OBP\/r.woba),0) as 'OBP+'\r\n    \/* NOT YET CONVERTED TO OOTP AND MYSQL\r\n    , round((b.h+[b.2b]+2*b.[3b]+3*b.hr)\/b.ab,3) as slg\r\n    , [obp]+[slg] as ops\r\n    , [slg]-[avg] as iso\r\n    , round((r.wobaBB*nz(b.bb,0) + r.wobahb*nz(b.hbp,0) + r.woba1b*(b.h-b.[2b]-b.[3b]-b.hr) + r.woba2b*b.[2b] + r.woba3b*b.[3b] + r.wobahr*b.hr)\/(b.ab+nz(b.bb,0)-nz(b.ibb,0)+nz(b.sf,0)+nz(b.hbp,0)),3) as woba\r\n    , round((([woba]-r.lgwoba)\/r.wobascale)*[PA],1) as wRAA\r\n    , round(((([woba]-r.lgwoba)\/r.wobascale)+(l.totr\/l.totpa))*[PA],0) as wRC\r\n    , ((([wRAA]\/[PA] + l.RperPA) + (l.RperPA - t.bpf*l.RperPA))\/(lb.wRC\/lb.PA))*100 AS [wRC+]\r\n    *\/\r\n    FROM \r\n      players_career_batting_stats b \r\n      INNER JOIN leagues l ON b.league_id=l.league_id \r\n      INNER JOIN teams t ON b.team_id=t.team_id\r\n      INNER JOIN tblRunValues2 r ON b.year=r.year AND b.league_id=r.league_id\r\n    WHERE b.ab&lt;&gt;0 AND b.split_id=1\r\n    ORDER BY b.player_id, b.year<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ll be adding to the scripts started yesterday working towards a complete script for all batting stats. \u00a0I&#8217;ll post the relevant bits of the code I&#8217;m working on in the main body and post the complete script as it stands beneath the fold. I&#8217;ll be tackling the easy calculated stats in this post, starting with&hellip; <a class=\"more-link\" href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147\">Continue reading <span class=\"screen-reader-text\">Batting Stats 2: Easy Calculated Stats<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[25],"tags":[14,7,4,22],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-batting","tag-batting","tag-mysql","tag-ootp","tag-players"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"cavebutter\"\/>\n\t<link rel=\"canonical\" href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"MySQL MyStruggle | Rolling my own MySQL Database with OOTP\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Easy Calculated Batting Stats | MySQL MyStruggle\" \/>\n\t\t<meta property=\"og:url\" content=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-09-29T20:07:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-09-29T20:07:54+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Easy Calculated Batting Stats | MySQL MyStruggle\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#article\",\"name\":\"Easy Calculated Batting Stats | MySQL MyStruggle\",\"headline\":\"Batting Stats 2: Easy Calculated Stats\",\"author\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/author\\\/cavebutter#author\"},\"publisher\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.ootp.cavebutter.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/OBP-Wierdness.jpg?fit=524%2C319\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147\\\/#articleImage\",\"width\":524,\"height\":319},\"datePublished\":\"2017-09-29T13:07:54-07:00\",\"dateModified\":\"2017-09-29T13:07:54-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#webpage\"},\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#webpage\"},\"articleSection\":\"Batting, batting, mysql, OOTP, players\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/category\\\/batting#listItem\",\"name\":\"Batting\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/category\\\/batting#listItem\",\"position\":2,\"name\":\"Batting\",\"item\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/category\\\/batting\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#listItem\",\"name\":\"Batting Stats 2: Easy Calculated Stats\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#listItem\",\"position\":3,\"name\":\"Batting Stats 2: Easy Calculated Stats\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/category\\\/batting#listItem\",\"name\":\"Batting\"}}]},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/#organization\",\"name\":\"MySQL MyStruggle\",\"description\":\"Rolling my own MySQL Database with OOTP\",\"url\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/author\\\/cavebutter#author\",\"url\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/author\\\/cavebutter\",\"name\":\"cavebutter\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3841893aa5a48e51f3ff3699f735196959f8b88a5ed3851eda2fed141b75cadc?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"cavebutter\"}},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#webpage\",\"url\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147\",\"name\":\"Easy Calculated Batting Stats | MySQL MyStruggle\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/147#breadcrumblist\"},\"author\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/author\\\/cavebutter#author\"},\"creator\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/archives\\\/author\\\/cavebutter#author\"},\"datePublished\":\"2017-09-29T13:07:54-07:00\",\"dateModified\":\"2017-09-29T13:07:54-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/#website\",\"url\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/\",\"name\":\"MySQL MyStruggle\",\"description\":\"Rolling my own MySQL Database with OOTP\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.ootp.cavebutter.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Easy Calculated Batting Stats | MySQL MyStruggle","description":"","canonical_url":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#article","name":"Easy Calculated Batting Stats | MySQL MyStruggle","headline":"Batting Stats 2: Easy Calculated Stats","author":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/author\/cavebutter#author"},"publisher":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/09\/OBP-Wierdness.jpg?fit=524%2C319","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147\/#articleImage","width":524,"height":319},"datePublished":"2017-09-29T13:07:54-07:00","dateModified":"2017-09-29T13:07:54-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#webpage"},"isPartOf":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#webpage"},"articleSection":"Batting, batting, mysql, OOTP, players"},{"@type":"BreadcrumbList","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog#listItem","position":1,"name":"Home","item":"http:\/\/www.ootp.cavebutter.net\/blog","nextItem":{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting#listItem","name":"Batting"}},{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting#listItem","position":2,"name":"Batting","item":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting","nextItem":{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#listItem","name":"Batting Stats 2: Easy Calculated Stats"},"previousItem":{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#listItem","position":3,"name":"Batting Stats 2: Easy Calculated Stats","previousItem":{"@type":"ListItem","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting#listItem","name":"Batting"}}]},{"@type":"Organization","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/#organization","name":"MySQL MyStruggle","description":"Rolling my own MySQL Database with OOTP","url":"http:\/\/www.ootp.cavebutter.net\/blog\/"},{"@type":"Person","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/author\/cavebutter#author","url":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/author\/cavebutter","name":"cavebutter","image":{"@type":"ImageObject","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/3841893aa5a48e51f3ff3699f735196959f8b88a5ed3851eda2fed141b75cadc?s=96&d=mm&r=g","width":96,"height":96,"caption":"cavebutter"}},{"@type":"WebPage","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#webpage","url":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147","name":"Easy Calculated Batting Stats | MySQL MyStruggle","inLanguage":"en-US","isPartOf":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/#website"},"breadcrumb":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147#breadcrumblist"},"author":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/author\/cavebutter#author"},"creator":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/author\/cavebutter#author"},"datePublished":"2017-09-29T13:07:54-07:00","dateModified":"2017-09-29T13:07:54-07:00"},{"@type":"WebSite","@id":"http:\/\/www.ootp.cavebutter.net\/blog\/#website","url":"http:\/\/www.ootp.cavebutter.net\/blog\/","name":"MySQL MyStruggle","description":"Rolling my own MySQL Database with OOTP","inLanguage":"en-US","publisher":{"@id":"http:\/\/www.ootp.cavebutter.net\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"MySQL MyStruggle | Rolling my own MySQL Database with OOTP","og:type":"article","og:title":"Easy Calculated Batting Stats | MySQL MyStruggle","og:url":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147","article:published_time":"2017-09-29T20:07:54+00:00","article:modified_time":"2017-09-29T20:07:54+00:00","twitter:card":"summary","twitter:title":"Easy Calculated Batting Stats | MySQL MyStruggle"},"aioseo_meta_data":{"post_id":"147","title":"Easy Calculated Batting Stats | #site_title","description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-02-03 03:39:37","updated":"2025-12-10 01:12:40","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.ootp.cavebutter.net\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting\" title=\"Batting\">Batting<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBatting Stats 2: Easy Calculated Stats\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"http:\/\/www.ootp.cavebutter.net\/blog"},{"label":"Batting","link":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/category\/batting"},{"label":"Batting Stats 2: Easy Calculated Stats","link":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/147"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9cxb5-2n","jetpack_likes_enabled":true,"jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":3,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":151,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions\/151"}],"wp:attachment":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}