{"id":1274,"date":"2024-03-21T11:28:07","date_gmt":"2024-03-21T15:28:07","guid":{"rendered":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1274"},"modified":"2024-03-21T11:28:07","modified_gmt":"2024-03-21T15:28:07","slug":"introduction-to-structured-query-language-for-data-analytics-ws24sql10001-day-4","status":"publish","type":"post","link":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1274","title":{"rendered":"Introduction to Structured Query Language for Data Analytics (WS24SQL10001) \u2014 Day 4"},"content":{"rendered":"<p>We continue working with functions and have introduced aggregate functions. We have also started adding logic to queries using <tt>CASE<\/tt> clauses.<\/p>\n<pre><span style=\"color: #0000ff\">    CASE<\/span>\r\n      <span style=\"color: #0000ff\">WHEN<\/span> condition1\r\n        <span style=\"color: #0000ff\">THEN<\/span> action1\r\n      <span style=\"color: #0000ff\">WHEN<\/span> condition2\r\n        <span style=\"color: #0000ff\">THEN<\/span> action2\r\n      <span style=\"color: #008000\">-- more conditions + actions<\/span>\r\n      <span style=\"color: #0000ff\">ELSE<\/span> escape_action\r\n    <span style=\"color: #0000ff\">END\r\n<\/span><\/pre>\n<p>Download the\u00a0<a href=\"https:\/\/folvera.commons.gc.cuny.edu\/wp-content\/blogs.dir\/2501\/files\/2024\/03\/WS24SQL10001_20240320.pdf\">class notes<\/a>\u00a0for day 4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We continue working with functions and have introduced aggregate functions. We have also started adding logic to queries using CASE clauses. CASE WHEN condition1 THEN action1 WHEN condition2 THEN action2 &#8212; more conditions + actions ELSE escape_action END Download the\u00a0class notes\u00a0for day 4.<\/p>\n","protected":false},"author":7213,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"send_to_group_blog":0,"footnotes":""},"categories":[34,3,1,2],"tags":[],"class_list":["post-1274","post","type-post","status-publish","format-standard","hentry","category-ws24sql10001","category-computer-programming","category-cuny","category-sql"],"_links":{"self":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/users\/7213"}],"replies":[{"embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1274"}],"version-history":[{"count":1,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1274\/revisions"}],"predecessor-version":[{"id":1276,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1274\/revisions\/1276"}],"wp:attachment":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}