{"id":1282,"date":"2024-03-28T09:11:03","date_gmt":"2024-03-28T13:11:03","guid":{"rendered":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1282"},"modified":"2024-03-28T09:11:03","modified_gmt":"2024-03-28T13:11:03","slug":"introduction-to-structured-query-language-for-data-analytics-ws24sql10001-day-6","status":"publish","type":"post","link":"https:\/\/folvera.commons.gc.cuny.edu\/?p=1282","title":{"rendered":"Introduction to Structured Query Language for Data Analytics (WS24SQL10001) \u2014 Day 6"},"content":{"rendered":"<p>We have finally gotten our feet wet creating database objects.<\/p>\n<pre><span style=\"color: #0000ff\">    CREATE <\/span>data_obj data_name [code];\r\n\r\n    <span style=\"color: #0000ff\">CREATE DATABASE <\/span>db_name; <span style=\"color: #008000\">-- no extra code<\/span>\r\n\r\n    <span style=\"color: #0000ff\">CREATE SCHEMA <\/span>schema_name; <span style=\"color: #008000\">-- no extra code<\/span>\r\n\r\n    <span style=\"color: #0000ff\">CREATE TABLE <\/span>table_name <span style=\"color: #008000\">-- code for structure<\/span>\r\n      (\r\n      field1 data_type [arguments],\r\n      field2 data_type [arguments]\r\n      );\r\n\r\n    <span style=\"color: #0000ff\">CREATE VIEW <\/span>view_name <span style=\"color: #008000\">-- code for structure<\/span>\r\n    <span style=\"color: #0000ff\">AS<\/span>\r\n    <span style=\"color: #0000ff\">SELECT<\/span> field1,\r\n      field2\r\n    <span style=\"color: #0000ff\">FROM<\/span> table1;\r\n<\/pre>\n<p>Download the <a href=\"https:\/\/folvera.commons.gc.cuny.edu\/wp-content\/blogs.dir\/2501\/files\/2024\/03\/WS24SQL10001_20240327.pdf\">class notes<\/a> for day 6.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have finally gotten our feet wet creating database objects. CREATE data_obj data_name [code]; CREATE DATABASE db_name; &#8212; no extra code CREATE SCHEMA schema_name; &#8212; no extra code CREATE TABLE table_name &#8212; code for structure ( field1 data_type [arguments], field2 data_type [arguments] ); CREATE VIEW view_name &#8212; code for structure AS SELECT field1, field2 FROM [&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-1282","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\/1282","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=1282"}],"version-history":[{"count":3,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions"}],"predecessor-version":[{"id":1286,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions\/1286"}],"wp:attachment":[{"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/folvera.commons.gc.cuny.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}