{"id":666,"date":"2018-06-05T10:18:26","date_gmt":"2018-06-05T14:18:26","guid":{"rendered":"https:\/\/folvera.commons.gc.cuny.edu\/?p=666"},"modified":"2021-09-16T14:57:51","modified_gmt":"2021-09-16T18:57:51","slug":"database-administration-fundamentals-ws18sql1002-day-4","status":"publish","type":"post","link":"https:\/\/folvera.commons.gc.cuny.edu\/?p=666","title":{"rendered":"Database Administration Fundamentals (WS18SQL1002) \u2013 Day 4"},"content":{"rendered":"<p>We are almost half way done with the course. We have covered how to retrieve data (<tt>SELECT<\/tt>), filtering data (<tt>WHERE<\/tt>), organizing data (<tt>ORDER BY<\/tt>), grouping data (<tt>GROUP BY<\/tt>) when using aggregate functions and formatting numeric values (<tt>FORMAT()<\/tt>).<\/p>\n<pre>SELECT table1.field1, table1.field2...\r\n  table2.field1, table2.field2...\r\n  table3.field1, table3.field2...\r\nFROM table1\r\nINNER|LEFT|RIGHT JOIN table2\r\n  ON table1.shared_field1 = table2.shared_field1\r\n    AND table1.shared_field2 = table2.shared_field2\r\nINNER|LEFT|RIGHT JOIN table3\r\n  ON table1.shared_field1 = table3.shared_field1\r\n    AND table1.shared_field2 = table3.shared_field2...\r\nWHERE condition1\r\n  AND|OR condition2\r\n  ...\r\n<\/pre>\n<p>Download the\u00a0<a title=\"Class Notes for WS18SQL1002 - Day 4 (2018\/06\/04)\" href=\"https:\/\/folvera.commons.gc.cuny.edu\/wp-content\/blogs.dir\/2501\/files\/2018\/06\/WS18SQL1002_20180604.pdf\">class notes<\/a>\u00a0for day 4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are almost half way done with the course. We have covered how to retrieve data (SELECT), filtering data (WHERE), organizing data (ORDER BY), grouping data (GROUP BY) when using aggregate functions and formatting numeric values (FORMAT()). SELECT table1.field1, table1.field2&#8230; table2.field1, table2.field2&#8230; table3.field1, table3.field2&#8230; FROM table1 INNER|LEFT|RIGHT JOIN table2 ON table1.shared_field1 = table2.shared_field1 AND table1.shared_field2 [&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":[22,3,1,17,2],"tags":[],"class_list":["post-666","post","type-post","status-publish","format-standard","hentry","category-ws18sql1002","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\/666","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=666"}],"version-history":[{"count":1,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/666\/revisions"}],"predecessor-version":[{"id":668,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/666\/revisions\/668"}],"wp:attachment":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}