{"id":1277,"date":"2024-03-26T10:14:25","date_gmt":"2024-03-26T14:14:25","guid":{"rendered":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1277"},"modified":"2024-03-26T10:14:25","modified_gmt":"2024-03-26T14:14:25","slug":"introduction-to-structured-query-language-for-data-analytics-ws24sql10001-day-5","status":"publish","type":"post","link":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1277","title":{"rendered":"Introduction to Structured Query Language for Data Analytics (WS24SQL10001) \u2014 Day 5"},"content":{"rendered":"<p>We are half-way done with the course. We have covered how to query data and manipulate the output using functions.<\/p>\n<pre><span style=\"color: #0000ff\">    SELECT<\/span> <span style=\"color: #0000ff\">FUNCTION<\/span>(field1) <span style=\"color: #0000ff\">AS<\/span> alias,\r\n      field2,\r\n      field3\r\n    <span style=\"color: #0000ff\">FROM<\/span> table1 <span style=\"color: #0000ff\">AS<\/span> t1\r\n    <span style=\"color: #0000ff\">INNER|LEFT|RIGHT JOIN<\/span> table2 <span style=\"color: #0000ff\">AS<\/span> t2\r\n      <span style=\"color: #0000ff\">ON<\/span> t1.shared_data = t2.shared_data\r\n    <span style=\"color: #0000ff\">GROUP BY<\/span> field2, <span style=\"color: #008000\">-- needed for aggregate functions<\/span>\r\n      field3\r\n    <span style=\"color: #0000ff\">ORDER BY<\/span> field1;\r\n<\/pre>\n<p>We are almost ready to work with database objects.<\/p>\n<p>Download the <a href=\"https:\/\/folvera.commons.gc.cuny.edu\/wp-content\/blogs.dir\/2501\/files\/2024\/03\/WS24SQL10001_20240325.pdf\">class notes<\/a> for day 5.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are half-way done with the course. We have covered how to query data and manipulate the output using functions. SELECT FUNCTION(field1) AS alias, field2, field3 FROM table1 AS t1 INNER|LEFT|RIGHT JOIN table2 AS t2 ON t1.shared_data = t2.shared_data GROUP BY field2, &#8212; needed for aggregate functions field3 ORDER BY field1; We are almost ready [&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":[34,3,1,2],"tags":[],"class_list":["post-1277","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\/1277","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=1277"}],"version-history":[{"count":1,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1277\/revisions"}],"predecessor-version":[{"id":1279,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1277\/revisions\/1279"}],"wp:attachment":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}