{"id":756,"date":"2018-08-28T09:43:30","date_gmt":"2018-08-28T13:43:30","guid":{"rendered":"https:\/\/folvera.commons.gc.cuny.edu\/?p=756"},"modified":"2021-09-16T14:57:40","modified_gmt":"2021-09-16T18:57:40","slug":"database-administration-fundamentals-sf18sql10001-day-3","status":"publish","type":"post","link":"https:\/\/folvera.commons.gc.cuny.edu\/?p=756","title":{"rendered":"Database Administration Fundamentals (SF18SQL10001) \u2013 Day 3"},"content":{"rendered":"<p>So far, we have covered the two ways you can concatenate strings (using function <tt>`CONCAT()`<\/tt> or using the <tt>`+`<\/tt> sign). We understand that using the <tt>`+`<\/tt> sign has limitations. When adding a string to a <tt>NULL<\/tt>, your result is a <tt>NULL<\/tt>. To avoid the latter, we can use a <tt>`CASE`<\/tt> clause.<\/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: #0000ff\">ELSE<\/span>   escape_action\r\n  <span style=\"color: #0000ff\">END\r\n<\/span><\/pre>\n<p>Download the\u00a0<a title=\"Class Notes for SF18SQL10001 - Day 3 (2018\/08\/27)\" href=\"https:\/\/folvera.commons.gc.cuny.edu\/wp-content\/blogs.dir\/2501\/files\/2018\/08\/SF18SQL10001_20180827.pdf\">class notes<\/a>\u00a0for day 3.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So far, we have covered the two ways you can concatenate strings (using function `CONCAT()` or using the `+` sign). We understand that using the `+` sign has limitations. When adding a string to a NULL, your result is a NULL. To avoid the latter, we can use a `CASE` clause. CASE WHEN condition1 THEN [&hellip;]<\/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":[24,3,1,17,2],"tags":[],"class_list":["post-756","post","type-post","status-publish","format-standard","hentry","category-sf18sql10001","category-computer-programming","category-cuny","category-open-source","category-sql"],"_links":{"self":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/756","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=756"}],"version-history":[{"count":2,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/756\/revisions"}],"predecessor-version":[{"id":759,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/756\/revisions\/759"}],"wp:attachment":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}